~ubuntu-branches/ubuntu/precise/maas/precise-updates

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Description: Ensures that commands are always executed.
 Do not check current node state when executing an ipmi
 command, which ensures that nodes are always turned on/off
 regardless of their power state. This fixes corner cases
 found when running automated tests.
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1171418

--- maas-1.2+bzr1373+dfsg.orig/src/provisioningserver/power/templates/ipmi.template	2013-03-20 13:59:10.000000000 -0400
+++ maas-1.2+bzr1373+dfsg/src/provisioningserver/power/templates/ipmi.template	2013-08-12 13:36:17.241183232 -0400
@@ -45,7 +45,7 @@
     driver_option=""
     if [ -n "$power_driver" ]
         then
-          driver_option="--driver-type=$power_driver"
+          driver_option="--driver-type=${power_driver}"
     fi
 
     echo workaround |\
@@ -54,16 +54,8 @@
     ${ipmipower} ${driver_option} -h ${power_address} -u ${power_user} -p ${power_pass} "$@"
 }
 
-
-# Get the given system's power state: 'on' or 'off'.
-get_power_state() {
-    ipmi_state=$(issue_ipmi_command stat)
-    formulate_power_state ${ipmi_state}
-}
-
-
-if [ "$(get_power_state)" != "${power_change}" ]
-then
-    power_command=$(formulate_power_command ${power_change})
-    issue_ipmi_command ${power_command}
-fi
+# This script deliberately does not check the current power state
+# before issuing the requested power command. See bug 1171418 for an
+# explanation.
+power_command=$(formulate_power_command ${power_change})
+issue_ipmi_command ${power_command}