launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #08803
[Merge] lp:~julian-edwards/maas/fix-power-params into lp:maas
Julian Edwards has proposed merging lp:~julian-edwards/maas/fix-power-params into lp:maas.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #1012973 in MAAS: "virsh power script not using correct parameters"
https://bugs.launchpad.net/maas/+bug/1012973
For more details, see:
https://code.launchpad.net/~julian-edwards/maas/fix-power-params/+merge/110234
As per the bug, the virsh power script is not using the correct parameters. Most importantly the power_address was being ignored.
--
https://code.launchpad.net/~julian-edwards/maas/fix-power-params/+merge/110234
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~julian-edwards/maas/fix-power-params into lp:maas.
=== modified file 'src/maasserver/models/__init__.py'
--- src/maasserver/models/__init__.py 2012-06-08 03:01:10 +0000
+++ src/maasserver/models/__init__.py 2012-06-14 06:06:19 +0000
@@ -610,7 +610,9 @@
power_params.setdefault('system_id', self.system_id)
power_params.setdefault('virsh', '/usr/bin/virsh')
- power_params.setdefault('virsh_url', 'qemu://localhost/')
+ power_params.setdefault('power_address', 'qemu://localhost/system')
+ power_params.setdefault('username', '')
+ power_params.setdefault('power_id', self.system_id)
# The "mac" parameter defaults to the node's primary MAC
# address, but only if no power parameters were set at all.
=== modified file 'src/provisioningserver/power/templates/virsh.template'
--- src/provisioningserver/power/templates/virsh.template 2012-06-08 16:05:50 +0000
+++ src/provisioningserver/power/templates/virsh.template 2012-06-14 06:06:19 +0000
@@ -5,7 +5,9 @@
# Parameters.
power_change={{power_change}}
-virsh_url={{virsh_url}}
+power_address={{power_address}}
+power_id={{power_id}}
+username={{username}}
system_id={{system_id}}
virsh={{virsh}}
@@ -35,7 +37,7 @@
# Issue command to virsh, for the given system.
issue_virsh_command() {
- ${virsh} --connect ${virsh_url}/system $1 ${system_id}
+ ${virsh} --connect ${power_address} $1 ${power_id}
}
=== modified file 'src/provisioningserver/power/tests/test_poweraction.py'
--- src/provisioningserver/power/tests/test_poweraction.py 2012-06-11 10:36:36 +0000
+++ src/provisioningserver/power/tests/test_poweraction.py 2012-06-14 06:06:19 +0000
@@ -124,7 +124,7 @@
action = PowerAction(POWER_TYPE.VIRSH)
script = action.render_template(
action.get_template(), power_change='on',
- virsh_url='qemu://example.com/', system_id='mysystem',
- virsh='echo')
+ power_address='qemu://example.com/', system_id='mysystem',
+ power_id='mysystem', username='me', virsh='echo')
stdout, stderr = action.run_shell(script)
self.assertIn("Got unknown power state from virsh", stderr)
Follow ups