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

15.4.2 by Andres Rodriguez
* MAAS Stable Release Update, debian/patches:
1
Description: Ensures that commands are always executed.
2
 Do not check current node state when executing an ipmi
3
 command, which ensures that nodes are always turned on/off
4
 regardless of their power state. This fixes corner cases
5
 found when running automated tests.
6
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1171418
7
8
--- maas-1.2+bzr1373+dfsg.orig/src/provisioningserver/power/templates/ipmi.template	2013-03-20 13:59:10.000000000 -0400
9
+++ maas-1.2+bzr1373+dfsg/src/provisioningserver/power/templates/ipmi.template	2013-08-12 13:36:17.241183232 -0400
10
@@ -45,7 +45,7 @@
11
     driver_option=""
12
     if [ -n "$power_driver" ]
13
         then
14
-          driver_option="--driver-type=$power_driver"
15
+          driver_option="--driver-type=${power_driver}"
16
     fi
17
 
18
     echo workaround |\
19
@@ -54,16 +54,8 @@
20
     ${ipmipower} ${driver_option} -h ${power_address} -u ${power_user} -p ${power_pass} "$@"
21
 }
22
 
23
-
24
-# Get the given system's power state: 'on' or 'off'.
25
-get_power_state() {
26
-    ipmi_state=$(issue_ipmi_command stat)
27
-    formulate_power_state ${ipmi_state}
28
-}
29
-
30
-
31
-if [ "$(get_power_state)" != "${power_change}" ]
32
-then
33
-    power_command=$(formulate_power_command ${power_change})
34
-    issue_ipmi_command ${power_command}
35
-fi
36
+# This script deliberately does not check the current power state
37
+# before issuing the requested power command. See bug 1171418 for an
38
+# explanation.
39
+power_command=$(formulate_power_command ${power_change})
40
+issue_ipmi_command ${power_command}