2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 04:07:48 +00:00

Merge "Added password file support"

This commit is contained in:
Jenkins 2014-06-02 18:03:55 +00:00 committed by Gerrit Code Review
commit 8c66abb200

View File

@ -40,8 +40,6 @@ tty.setraw(sys.stdin.fileno())
currfl = fcntl.fcntl(sys.stdin.fileno(), fcntl.F_GETFL)
fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, currfl | os.O_NONBLOCK)
passwd = os.environ['IPMIPASSWORD']
sol = None
@ -67,6 +65,13 @@ def _print(data):
raise Exception(data)
try:
if sys.argv[3] is None:
passwd = os.environ['IPMIPASSWORD']
else:
passwd_file = sys.argv[3]
with open(passwd_file, "r") as f:
passwd = f.read()
sol = console.Console(bmc=sys.argv[1], userid=sys.argv[2], password=passwd,
iohandler=_print, force=True)
inputthread = threading.Thread(target=_doinput)