From ed5e5b84d6818458f00ac49186212af0ebd0610c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Thu, 7 Jan 2010 13:39:33 +0000 Subject: [PATCH] pass the user/password as command paramters --- pcucontrol/models/DRAC.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 -- 2.43.0