From: Barış Metin Date: Thu, 7 Jan 2010 13:39:33 +0000 (+0000) Subject: pass the user/password as command paramters X-Git-Tag: pcucontrol-1.0-1~4 X-Git-Url: http://git.onelab.eu/?p=pcucontrol.git;a=commitdiff_plain;h=ed5e5b84d6818458f00ac49186212af0ebd0610c pass the user/password as command paramters --- diff --git a/pcucontrol/models/DRAC.py b/pcucontrol/models/DRAC.py index 898b5e5..7cc4981 100644 --- a/pcucontrol/models/DRAC.py +++ b/pcucontrol/models/DRAC.py @@ -91,9 +91,6 @@ def runcmd(command, args, username, password, timeout = None): p = popen2.Popen4(command) # read all output data - p.tochild.write("%s\n" % username) - p.tochild.write("%s\n" % password) - p.tochild.close() data = p.fromchild.read() while True: @@ -148,10 +145,10 @@ def racadm_reboot(host, username, password, port, dryrun): cmd = "/usr/sbin/racadm" os.stat(cmd) if not dryrun: - output = runcmd(cmd, ["-r %s -i serveraction powercycle" % ip], + output = runcmd(cmd, ["-r %s -u %s -p %s serveraction powercycle" % (ip, username, password)], username, password) else: - output = runcmd(cmd, ["-r %s -i getsysinfo" % ip], + output = runcmd(cmd, ["-r %s -u %s -p %s getsysinfo" % (ip, username, password)], username, password) print "RUNCMD: %s" % output