Skip to content

Commit 4eeb0b9

Browse files
committed
Chain up to superclass tearDown in ServerActionsTest
I noticed that HostTestCase was failing if run on its own because allow_admin_api wasn't set - it worked fine when the full suite was run because the flag was being leaked from ServerActionsTest. Change-Id: I9072f84f017125536d1f261165c44413964f5708
1 parent 821fae9 commit 4eeb0b9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

nova/tests/api/openstack/test_server_actions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ def setUp(self):
136136

137137
def tearDown(self):
138138
self.stubs.UnsetAll()
139+
super(ServerActionsTest, self).tearDown()
139140

140141
def test_server_bad_body(self):
141142
body = {}

nova/tests/test_hosts.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,17 @@ def test_enable_host(self):
9494
self.assertEqual(result_c2["status"], "disabled")
9595

9696
def test_host_startup(self):
97+
self.flags(allow_admin_api=True)
9798
result = self.controller.startup(self.req, "host_c1")
9899
self.assertEqual(result["power_action"], "startup")
99100

100101
def test_host_shutdown(self):
102+
self.flags(allow_admin_api=True)
101103
result = self.controller.shutdown(self.req, "host_c1")
102104
self.assertEqual(result["power_action"], "shutdown")
103105

104106
def test_host_reboot(self):
107+
self.flags(allow_admin_api=True)
105108
result = self.controller.reboot(self.req, "host_c1")
106109
self.assertEqual(result["power_action"], "reboot")
107110

0 commit comments

Comments
 (0)