Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added --port option to hpilo_cli to allow for non-standard iLO settings. #1

Merged
merged 1 commit into from
Jan 16, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hpilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class Ilo(object):
XML_HEADER = '<?xml version="1.0"?>\r\n'
HTTP_HEADER = "POST /ribcl HTTP/1.1\r\nHost: localhost\r\nContent-length: %d\r\nConnection: Close\r\n\r\n"

def __init__(self, hostname, login, password, timeout=60):
def __init__(self, hostname, login, password, timeout=60, port=443):
self.hostname = hostname
self.login = login
self.password = password
self.timeout = timeout
self.debug = 0
self.protocol = None
self.port = 443
self.port = port

def __str__(self):
return "iLO interface of %s" % self.hostname
Expand Down
4 changes: 3 additions & 1 deletion hpilo_cli
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Supported methods:
help="Use the specified protocol instead of autodetecting")
p.add_option("-d", "--debug", dest="debug", action="count", default=0,
help="Output debug information, repeat to see all XML data")
p.add_option("-o", "--port", dest="port", type="int", default=443,
help="SSL port to connect to")
p.add_option("-h", "--help", action="callback", callback=hpilo_help,
help="show this help message or help for a method")

Expand Down Expand Up @@ -99,7 +101,7 @@ Supported methods:
p.print_help()
p.exit()

ilo = hpilo.Ilo(hostname, login, password, opts.timeout)
ilo = hpilo.Ilo(hostname, login, password, opts.timeout, opts.port)
ilo.debug = opts.debug
if opts.protocol == 'http':
ilo.protocol = hpilo.ILO_HTTP
Expand Down