launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #14912
[Merge] lp:~andreserl/maas/ipmi_versioning_support_lp1086162_1.2 into lp:maas/1.2
Andres Rodriguez has proposed merging lp:~andreserl/maas/ipmi_versioning_support_lp1086162_1.2 into lp:maas/1.2.
Commit message:
Thanks to Raphael for this patch. I tested it and fixed a minor issue. Otherwise seems to be working as expected.
Requested reviews:
MAAS Maintainers (maas-maintainers)
Related bugs:
Bug #1086162 in MAAS: "IPMI based power management default to IPMI 1.5 based authentication"
https://bugs.launchpad.net/maas/+bug/1086162
For more details, see:
https://code.launchpad.net/~andreserl/maas/ipmi_versioning_support_lp1086162_1.2/+merge/143194
--
https://code.launchpad.net/~andreserl/maas/ipmi_versioning_support_lp1086162_1.2/+merge/143194
Your team MAAS Maintainers is requested to review the proposed merge of lp:~andreserl/maas/ipmi_versioning_support_lp1086162_1.2 into lp:maas/1.2.
=== modified file 'src/maasserver/models/node.py'
--- src/maasserver/models/node.py 2012-12-20 14:20:58 +0000
+++ src/maasserver/models/node.py 2013-01-14 22:13:24 +0000
@@ -760,6 +760,7 @@
power_params.setdefault('power_address', 'qemu://localhost/system')
power_params.setdefault('username', '')
power_params.setdefault('power_id', self.system_id)
+ power_params.setdefault('power_driver', '')
# The "mac" parameter defaults to the node's primary MAC
# address, but only if no power parameters were set at all.
=== modified file 'src/maasserver/power_parameters.py'
--- src/maasserver/power_parameters.py 2012-12-20 14:20:58 +0000
+++ src/maasserver/power_parameters.py 2013-01-14 22:13:24 +0000
@@ -33,7 +33,7 @@
from django import forms
from maasserver.config_forms import DictCharField
from maasserver.fields import MACAddressFormField
-from provisioningserver.enum import POWER_TYPE
+from provisioningserver.enum import POWER_TYPE, IPMI_DRIVER_CHOICES, IPMI_DRIVER
POWER_TYPE_PARAMETERS = {
@@ -87,6 +87,13 @@
DictCharField(
[
(
+ 'power_driver',
+ forms.ChoiceField(
+ label="Driver", required=False,
+ choices=IPMI_DRIVER_CHOICES,
+ initial=IPMI_DRIVER.DEFAULT)
+ ),
+ (
'power_address',
forms.CharField(label="IP Address or Hostname",
required=False)),
=== modified file 'src/provisioningserver/enum.py'
--- src/provisioningserver/enum.py 2012-12-20 14:20:58 +0000
+++ src/provisioningserver/enum.py 2013-01-14 22:13:24 +0000
@@ -12,6 +12,8 @@
__metaclass__ = type
__all__ = [
'ARP_HTYPE',
+ 'IPMI_DRIVER',
+ 'IPMI_DRIVER_CHOICES',
'POWER_TYPE',
'POWER_TYPE_CHOICES',
]
@@ -48,6 +50,19 @@
)
+class IPMI_DRIVER:
+ DEFAULT = ''
+ LAN = 'LAN'
+ LAN_2_0 = 'LAN_2_0'
+
+
+IPMI_DRIVER_CHOICES = (
+ (IPMI_DRIVER.DEFAULT, "Auto-detect"),
+ (IPMI_DRIVER.LAN, "LAN (IPMI 1.5)"),
+ (IPMI_DRIVER.LAN_2_0, "LAN_2_0 (IPMI 2.0)"),
+ )
+
+
class ARP_HTYPE:
"""ARP Hardware Type codes."""
=== modified file 'src/provisioningserver/power/templates/ipmi.template'
--- src/provisioningserver/power/templates/ipmi.template 2012-12-21 15:13:24 +0000
+++ src/provisioningserver/power/templates/ipmi.template 2013-01-14 22:13:24 +0000
@@ -8,6 +8,7 @@
power_address={{power_address}}
power_user={{power_user}}
power_pass={{power_pass}}
+power_driver={{power_driver}}
ipmipower={{ipmipower}}
ipmi_chassis_config={{ipmi_chassis_config}}
config={{config_dir}}/{{ipmi_config}}
@@ -41,10 +42,16 @@
# Issue command to ipmipower, for the given system.
issue_ipmi_command() {
# See https://launchpad.net/bugs/1053391 for details of this workaround
- echo workaround |\
- ${ipmi_chassis_config} -h ${power_address} -u ${power_user} -p ${power_pass} --commit --filename ${config}
- echo workaround |\
- ${ipmipower} -h ${power_address} -u ${power_user} -p ${power_pass} "$@"
+ driver_option=""
+ if [ -n "$power_driver" ]
+ then
+ driver_option="--driver-type=$power_driver"
+ fi
+
+ echo workaround |\
+ ${ipmi_chassis_config} ${driver_option} -h ${power_address} -u ${power_user} -p ${power_pass} --commit --filename ${config}
+ echo workaround |\
+ ${ipmipower} ${driver_option} -h ${power_address} -u ${power_user} -p ${power_pass} "$@"
}
=== modified file 'src/provisioningserver/power/tests/test_poweraction.py'
--- src/provisioningserver/power/tests/test_poweraction.py 2012-12-20 14:20:58 +0000
+++ src/provisioningserver/power/tests/test_poweraction.py 2013-01-14 22:13:24 +0000
@@ -179,7 +179,7 @@
action.get_template(), power_change='on',
power_address='mystystem', power_user='me', power_pass='me',
ipmipower='echo', ipmi_chassis_config='echo', config_dir='dir',
- ipmi_config='file.conf')
+ ipmi_config='file.conf', power_driver='LAN')
stdout, stderr = action.run_shell(script)
self.assertIn("Got unknown power state from ipmipower", stderr)
@@ -204,5 +204,5 @@
action.get_template(), power_change='on',
power_address='mystystem', power_user='me', power_pass='me',
ipmipower='echo', ipmi_chassis_config='echo', config_dir='dir',
- ipmi_config='file.conf')
+ ipmi_config='file.conf', power_driver='LAN')
self.assertIn(conf_dir, script)
Follow ups