Fix stack delete error with none cluster
Before stack delete, I delete cluster first, and then stack delete failed. Change-Id: I523575668e5f52728116c68761aa221cb27fa132 Story: #2002623 Task: 22253
This commit is contained in:
parent
a4a6a00809
commit
28003004d8
|
@ -67,7 +67,7 @@ class OpenStackSDKPlugin(client_plugin.ClientPlugin):
|
||||||
return interfaces
|
return interfaces
|
||||||
|
|
||||||
def is_not_found(self, ex):
|
def is_not_found(self, ex):
|
||||||
return isinstance(ex, exceptions.ResourceNotFound)
|
return isinstance(ex, exceptions.NotFoundException)
|
||||||
|
|
||||||
def find_network_segment(self, value):
|
def find_network_segment(self, value):
|
||||||
return self.client().network.find_segment(value).id
|
return self.client().network.find_segment(value).id
|
||||||
|
|
|
@ -21,14 +21,23 @@ from heat.tests import utils
|
||||||
|
|
||||||
|
|
||||||
class OpenStackSDKPluginTest(common.HeatTestCase):
|
class OpenStackSDKPluginTest(common.HeatTestCase):
|
||||||
|
|
||||||
@mock.patch('openstack.connection.Connection')
|
@mock.patch('openstack.connection.Connection')
|
||||||
def test_create(self, mock_connection):
|
def setUp(self, mock_connection):
|
||||||
|
super(OpenStackSDKPluginTest, self).setUp()
|
||||||
context = utils.dummy_context()
|
context = utils.dummy_context()
|
||||||
plugin = context.clients.client_plugin('openstack')
|
self.plugin = context.clients.client_plugin('openstack')
|
||||||
client = plugin.client()
|
|
||||||
|
def test_create(self):
|
||||||
|
client = self.plugin.client()
|
||||||
self.assertIsNotNone(client.network.segments)
|
self.assertIsNotNone(client.network.segments)
|
||||||
|
|
||||||
|
def test_is_not_found(self):
|
||||||
|
self.assertFalse(self.plugin.is_not_found(
|
||||||
|
exceptions.HttpException(http_status=400)))
|
||||||
|
self.assertFalse(self.plugin.is_not_found(Exception))
|
||||||
|
self.assertTrue(self.plugin.is_not_found(
|
||||||
|
exceptions.NotFoundException(http_status=404)))
|
||||||
|
|
||||||
|
|
||||||
class SegmentConstraintTest(common.HeatTestCase):
|
class SegmentConstraintTest(common.HeatTestCase):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue