X-Git-Url: http://git.onelab.eu/?p=pcucontrol.git;a=blobdiff_plain;f=pcucontrol%2Fmodels%2Fexp%2FDRAC.exp;fp=pcucontrol%2Fmodels%2Fexp%2FDRAC.exp;h=57b5e466c6f40642b465374e1c8a3d6ebd3d7df3;hp=fc83df77f87e6f89ab3c8a01bf5cc3dffa958fe2;hb=dd516e0f7a0f19fbc20204be8acca09687919db9;hpb=51e66ab7b975799462e6b6c93494f4781fecacf7 diff --git a/pcucontrol/models/exp/DRAC.exp b/pcucontrol/models/exp/DRAC.exp index fc83df7..57b5e46 100755 --- a/pcucontrol/models/exp/DRAC.exp +++ b/pcucontrol/models/exp/DRAC.exp @@ -62,9 +62,11 @@ if { "$method" == "ssh" } { } else { if { [string match "*racadm*" $method] } { if { "$dryrun" == "True" } { - set rac_cmd "getsysinfo" + set rac_cmd_a "getsysinfo" + set rac_cmd_b "" } else { - set rac_cmd "serveraction powercycle" + set rac_cmd_a "serveraction" + set rac_cmd_b "powercycle" } #send_user "/opt/dell/srvadmin/bin/$method -r $host -u $user -p '$password' $rac_cmd\n"; set cont 0 @@ -74,10 +76,20 @@ if { "$method" == "ssh" } { # on the cmdline causes racadm to fail. # NOTE: For unknown reason, some DRAC modules work only with # stderr redirected to stdout, others only work without it. + # NOTE: For unknown reason, the racadm cmd does not recognize "serveraction powercycle" + # but does recognize "serveraction" "powercycle" if { $retry == 0 } { - set x [ spawn /opt/dell/srvadmin/rac5/bin/$method -i -r $host $rac_cmd 2>&1 ] + if { "$rac_cmd_a" == "getsysinfo" } { + set x [ spawn /opt/dell/srvadmin/rac5/bin/$method -i -r $host $rac_cmd_a ] + } else { + set x [ spawn /opt/dell/srvadmin/rac5/bin/$method -i -r $host $rac_cmd_a $rac_cmd_b ] + } } else { - set x [ spawn /opt/dell/srvadmin/rac5/bin/$method -i -r $host $rac_cmd ] + if { "$rac_cmd_a" == "getsysinfo" } { + set x [ spawn /opt/dell/srvadmin/rac5/bin/$method -i -r $host $rac_cmd_a 2>&1 ] + } else { + set x [ spawn /opt/dell/srvadmin/rac5/bin/$method -i -r $host $rac_cmd_a $rac_cmd_b 2>&1 ] + } } expect { @@ -92,10 +104,11 @@ if { "$method" == "ssh" } { -re "Authentication failed.*" { send_user "DRAC: $expect_out(0,string)"; exit } -re "This.*not support remote RACADM" { send_user "DRAC: $expect_out(0,string)" ; exit } -re "ERROR: The syntax of the command specified is not correct." { set cont 1 } + -re "ERROR: the command that was entered is not valid" { set cont 1 } -re "INVALID ARGUMENT" { send_user "DRAC: received 'INVALID ARGUMENT'\n"; exit } -re "RAC Information:" { sleep .1; } timeout { send_user "DRAC: timeout\n" ; exit } - eof { send_user "DRAC: early EOF\n"; exit ; } + eof { send_user "$reset_msg\n"; exit ; } #-re "ERROR:.*" { send_user "DRAC: $expect_out(0,string)"; exit } } if { $cont == 0 } { break; }