Merge ~ltrager/maas:lp1889788_2.8 into maas:2.8

Proposed by Lee Trager
Status: Merged
Approved by: Lee Trager
Approved revision: 56124bd8406d4fedf9ee6f8e9a056bf640a61111
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ltrager/maas:lp1889788_2.8
Merge into: maas:2.8
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
Lee Trager (community) Approve
Review via email: mp+388686@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.

Backport of c348e0c

To post a comment you must log in.
Revision history for this message
Lee Trager (ltrager) wrote :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp1889788_2.8 lp:~ltrager/maas/+git/maas into -b 2.8 lp:~maas-committers/maas

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/maas/job/branch-tester/8075/console
COMMIT: 56124bd8406d4fedf9ee6f8e9a056bf640a61111

review: Needs Fixing
Revision history for this message
Adam Collard (adam-collard) wrote :

jenkins: !test

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

UNIT TESTS
-b lp1889788_2.8 lp:~ltrager/maas/+git/maas into -b 2.8 lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 56124bd8406d4fedf9ee6f8e9a056bf640a61111

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/provisioningserver/drivers/power/ipmi.py b/src/provisioningserver/drivers/power/ipmi.py
2index 02d49a0..e99b807 100644
3--- a/src/provisioningserver/drivers/power/ipmi.py
4+++ b/src/provisioningserver/drivers/power/ipmi.py
5@@ -1,4 +1,4 @@
6-# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
7+# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
8 # GNU Affero General Public License version 3 (see the file LICENSE).
9
10 """IPMI Power Driver."""
11@@ -321,8 +321,16 @@ class IPMIPowerDriver(PowerDriver):
12 "ipmi-chassis-config",
13 "-W",
14 "opensesspriv",
15+ "-l",
16+ "OPERATOR",
17+ ]
18+ ipmipower_command = [
19+ "ipmipower",
20+ "-W",
21+ "opensesspriv",
22+ "-l",
23+ "OPERATOR",
24 ]
25- ipmipower_command = ["ipmipower", "-W", "opensesspriv"]
26
27 # Arguments in common between chassis config and power control. See
28 # https://launchpad.net/bugs/1053391 for details of modifying the
29diff --git a/src/provisioningserver/drivers/power/moonshot.py b/src/provisioningserver/drivers/power/moonshot.py
30index c8f2bf5..b8877c2 100644
31--- a/src/provisioningserver/drivers/power/moonshot.py
32+++ b/src/provisioningserver/drivers/power/moonshot.py
33@@ -1,4 +1,4 @@
34-# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
35+# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
36 # GNU Affero General Public License version 3 (see the file LICENSE).
37
38 """Moonshot IPMI Power Driver."""
39@@ -67,6 +67,8 @@ class MoonshotIPMIPowerDriver(PowerDriver):
40 power_user,
41 "-P",
42 power_pass,
43+ "-L",
44+ "OPERATOR",
45 ) + tuple(power_hwaddress.split())
46 if power_change == "pxe":
47 command += ("chassis", "bootdev", "pxe")
48diff --git a/src/provisioningserver/drivers/power/seamicro.py b/src/provisioningserver/drivers/power/seamicro.py
49index 7b5134d..18f5a7b 100644
50--- a/src/provisioningserver/drivers/power/seamicro.py
51+++ b/src/provisioningserver/drivers/power/seamicro.py
52@@ -1,4 +1,4 @@
53-# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
54+# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
55 # GNU Affero General Public License version 3 (see the file LICENSE).
56
57 """SeaMicro Power Driver."""
58@@ -83,6 +83,8 @@ class SeaMicroPowerDriver(PowerDriver):
59 username,
60 "-P",
61 password,
62+ "-L",
63+ "OPERATOR",
64 "raw",
65 "0x2E",
66 "1",
67diff --git a/src/provisioningserver/drivers/power/tests/test_ipmi.py b/src/provisioningserver/drivers/power/tests/test_ipmi.py
68index 866b3a5..5dd32a0 100644
69--- a/src/provisioningserver/drivers/power/tests/test_ipmi.py
70+++ b/src/provisioningserver/drivers/power/tests/test_ipmi.py
71@@ -1,4 +1,4 @@
72-# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
73+# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
74 # GNU Affero General Public License version 3 (see the file LICENSE).
75
76 """Tests for `provisioningserver.drivers.power.ipmi`."""
77@@ -53,6 +53,8 @@ def make_ipmi_chassis_config_command(
78 ipmi_chassis_config,
79 "-W",
80 "opensesspriv",
81+ "-l",
82+ "OPERATOR",
83 "--driver-type",
84 power_driver,
85 "-h",
86@@ -80,6 +82,8 @@ def make_ipmipower_command(
87 ipmipower,
88 "-W",
89 "opensesspriv",
90+ "-l",
91+ "OPERATOR",
92 "--driver-type",
93 power_driver,
94 "-h",
95diff --git a/src/provisioningserver/drivers/power/tests/test_moonshot.py b/src/provisioningserver/drivers/power/tests/test_moonshot.py
96index 6c2cb36..fa5b19e 100644
97--- a/src/provisioningserver/drivers/power/tests/test_moonshot.py
98+++ b/src/provisioningserver/drivers/power/tests/test_moonshot.py
99@@ -1,4 +1,4 @@
100-# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
101+# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
102 # GNU Affero General Public License version 3 (see the file LICENSE).
103
104 """Tests for `provisioningserver.drivers.power.ipmi`."""
105@@ -45,6 +45,8 @@ def make_command(
106 power_user,
107 "-P",
108 power_pass,
109+ "-L",
110+ "OPERATOR",
111 ) + tuple(power_hwaddress.split())
112
113
114diff --git a/src/provisioningserver/drivers/power/tests/test_seamicro.py b/src/provisioningserver/drivers/power/tests/test_seamicro.py
115index ab47cd1..9e18224 100644
116--- a/src/provisioningserver/drivers/power/tests/test_seamicro.py
117+++ b/src/provisioningserver/drivers/power/tests/test_seamicro.py
118@@ -1,4 +1,4 @@
119-# Copyright 2015-2016 Canonical Ltd. This software is licensed under the
120+# Copyright 2015-2020 Canonical Ltd. This software is licensed under the
121 # GNU Affero General Public License version 3 (see the file LICENSE).
122
123 """Tests for `provisioningserver.drivers.power.seamicro`."""
124@@ -85,6 +85,8 @@ class TestSeaMicroPowerDriver(MAASTestCase):
125 username,
126 "-P",
127 password,
128+ "-L",
129+ "OPERATOR",
130 "raw",
131 "0x2E",
132 "1",

Subscribers

People subscribed via source and target branches