Merge ~ltrager/maas:lp1889788 into maas:master

Proposed by Lee Trager
Status: Merged
Approved by: Lee Trager
Approved revision: fbdf236d531438694e1e01ab70962a084f402038
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ltrager/maas:lp1889788
Merge into: maas:master
Diff against target: 132 lines (+27/-7)
6 files modified
src/provisioningserver/drivers/power/ipmi.py (+10/-2)
src/provisioningserver/drivers/power/moonshot.py (+3/-1)
src/provisioningserver/drivers/power/seamicro.py (+3/-1)
src/provisioningserver/drivers/power/tests/test_ipmi.py (+5/-1)
src/provisioningserver/drivers/power/tests/test_moonshot.py (+3/-1)
src/provisioningserver/drivers/power/tests/test_seamicro.py (+3/-1)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Adam Collard (community) Approve
Review via email: mp+388511@code.launchpad.net

Commit message

LP: #1889788 - Always communicate with IPMI BMC's at OPERATOR level.

While the ipmipower command defaults to using OPERATOR the
ipmi-chassis-config and ipmitool commands both default to ADMIN.
Specify that OPERATOR should be used for all IPMI commands.

To post a comment you must log in.
Revision history for this message
Adam Collard (adam-collard) wrote :

Nice

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp1889788 lp:~ltrager/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: fbdf236d531438694e1e01ab70962a084f402038

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/provisioningserver/drivers/power/ipmi.py b/src/provisioningserver/drivers/power/ipmi.py
index 877fff9..53c3b31 100644
--- a/src/provisioningserver/drivers/power/ipmi.py
+++ b/src/provisioningserver/drivers/power/ipmi.py
@@ -1,4 +1,4 @@
1# Copyright 2015-2016 Canonical Ltd. This software is licensed under the1# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""IPMI Power Driver."""4"""IPMI Power Driver."""
@@ -322,8 +322,16 @@ class IPMIPowerDriver(PowerDriver):
322 "ipmi-chassis-config",322 "ipmi-chassis-config",
323 "-W",323 "-W",
324 "opensesspriv",324 "opensesspriv",
325 "-l",
326 "OPERATOR",
327 ]
328 ipmipower_command = [
329 "ipmipower",
330 "-W",
331 "opensesspriv",
332 "-l",
333 "OPERATOR",
325 ]334 ]
326 ipmipower_command = ["ipmipower", "-W", "opensesspriv"]
327335
328 # Arguments in common between chassis config and power control. See336 # Arguments in common between chassis config and power control. See
329 # https://launchpad.net/bugs/1053391 for details of modifying the337 # https://launchpad.net/bugs/1053391 for details of modifying the
diff --git a/src/provisioningserver/drivers/power/moonshot.py b/src/provisioningserver/drivers/power/moonshot.py
index 9608528..f66d15a 100644
--- a/src/provisioningserver/drivers/power/moonshot.py
+++ b/src/provisioningserver/drivers/power/moonshot.py
@@ -1,4 +1,4 @@
1# Copyright 2015-2016 Canonical Ltd. This software is licensed under the1# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Moonshot IPMI Power Driver."""4"""Moonshot IPMI Power Driver."""
@@ -68,6 +68,8 @@ class MoonshotIPMIPowerDriver(PowerDriver):
68 power_user,68 power_user,
69 "-P",69 "-P",
70 power_pass,70 power_pass,
71 "-L",
72 "OPERATOR",
71 ) + tuple(power_hwaddress.split())73 ) + tuple(power_hwaddress.split())
72 if power_change == "pxe":74 if power_change == "pxe":
73 command += ("chassis", "bootdev", "pxe")75 command += ("chassis", "bootdev", "pxe")
diff --git a/src/provisioningserver/drivers/power/seamicro.py b/src/provisioningserver/drivers/power/seamicro.py
index aee9b4c..26dbbf1 100644
--- a/src/provisioningserver/drivers/power/seamicro.py
+++ b/src/provisioningserver/drivers/power/seamicro.py
@@ -1,4 +1,4 @@
1# Copyright 2015-2016 Canonical Ltd. This software is licensed under the1# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""SeaMicro Power Driver."""4"""SeaMicro Power Driver."""
@@ -84,6 +84,8 @@ class SeaMicroPowerDriver(PowerDriver):
84 username,84 username,
85 "-P",85 "-P",
86 password,86 password,
87 "-L",
88 "OPERATOR",
87 "raw",89 "raw",
88 "0x2E",90 "0x2E",
89 "1",91 "1",
diff --git a/src/provisioningserver/drivers/power/tests/test_ipmi.py b/src/provisioningserver/drivers/power/tests/test_ipmi.py
index 866b3a5..5dd32a0 100644
--- a/src/provisioningserver/drivers/power/tests/test_ipmi.py
+++ b/src/provisioningserver/drivers/power/tests/test_ipmi.py
@@ -1,4 +1,4 @@
1# Copyright 2015-2016 Canonical Ltd. This software is licensed under the1# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for `provisioningserver.drivers.power.ipmi`."""4"""Tests for `provisioningserver.drivers.power.ipmi`."""
@@ -53,6 +53,8 @@ def make_ipmi_chassis_config_command(
53 ipmi_chassis_config,53 ipmi_chassis_config,
54 "-W",54 "-W",
55 "opensesspriv",55 "opensesspriv",
56 "-l",
57 "OPERATOR",
56 "--driver-type",58 "--driver-type",
57 power_driver,59 power_driver,
58 "-h",60 "-h",
@@ -80,6 +82,8 @@ def make_ipmipower_command(
80 ipmipower,82 ipmipower,
81 "-W",83 "-W",
82 "opensesspriv",84 "opensesspriv",
85 "-l",
86 "OPERATOR",
83 "--driver-type",87 "--driver-type",
84 power_driver,88 power_driver,
85 "-h",89 "-h",
diff --git a/src/provisioningserver/drivers/power/tests/test_moonshot.py b/src/provisioningserver/drivers/power/tests/test_moonshot.py
index 6c2cb36..fa5b19e 100644
--- a/src/provisioningserver/drivers/power/tests/test_moonshot.py
+++ b/src/provisioningserver/drivers/power/tests/test_moonshot.py
@@ -1,4 +1,4 @@
1# Copyright 2015-2016 Canonical Ltd. This software is licensed under the1# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for `provisioningserver.drivers.power.ipmi`."""4"""Tests for `provisioningserver.drivers.power.ipmi`."""
@@ -45,6 +45,8 @@ def make_command(
45 power_user,45 power_user,
46 "-P",46 "-P",
47 power_pass,47 power_pass,
48 "-L",
49 "OPERATOR",
48 ) + tuple(power_hwaddress.split())50 ) + tuple(power_hwaddress.split())
4951
5052
diff --git a/src/provisioningserver/drivers/power/tests/test_seamicro.py b/src/provisioningserver/drivers/power/tests/test_seamicro.py
index ab47cd1..9e18224 100644
--- a/src/provisioningserver/drivers/power/tests/test_seamicro.py
+++ b/src/provisioningserver/drivers/power/tests/test_seamicro.py
@@ -1,4 +1,4 @@
1# Copyright 2015-2016 Canonical Ltd. This software is licensed under the1# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
2# GNU Affero General Public License version 3 (see the file LICENSE).2# GNU Affero General Public License version 3 (see the file LICENSE).
33
4"""Tests for `provisioningserver.drivers.power.seamicro`."""4"""Tests for `provisioningserver.drivers.power.seamicro`."""
@@ -85,6 +85,8 @@ class TestSeaMicroPowerDriver(MAASTestCase):
85 username,85 username,
86 "-P",86 "-P",
87 password,87 password,
88 "-L",
89 "OPERATOR",
88 "raw",90 "raw",
89 "0x2E",91 "0x2E",
90 "1",92 "1",

Subscribers

People subscribed via source and target branches