From 7910c7228e0d56cc1dee7989797fe263286ebebc Mon Sep 17 00:00:00 2001 From: Everett Toews Date: Mon, 9 Mar 2015 17:16:45 -0500 Subject: [PATCH] Delete a Stack Change-Id: I40807848f606fdcbb9fa7fc6a600e6db77950b69 --- openstack/orchestration/v1/_proxy.py | 3 +++ openstack/orchestration/v1/stack.py | 1 + openstack/tests/orchestration/v1/test_proxy.py | 4 ++++ openstack/tests/orchestration/v1/test_stack.py | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/openstack/orchestration/v1/_proxy.py b/openstack/orchestration/v1/_proxy.py index a0525ddc..ebac4a25 100644 --- a/openstack/orchestration/v1/_proxy.py +++ b/openstack/orchestration/v1/_proxy.py @@ -24,3 +24,6 @@ class Proxy(proxy.BaseProxy): def get_stack(self, **data): return stack.Stack(data).get(self.session) + + def delete_stack(self, **data): + return stack.Stack(data).delete(self.session) diff --git a/openstack/orchestration/v1/stack.py b/openstack/orchestration/v1/stack.py index 93288b56..1ebafacd 100644 --- a/openstack/orchestration/v1/stack.py +++ b/openstack/orchestration/v1/stack.py @@ -24,6 +24,7 @@ class Stack(resource.Resource): # NOTE(thowe): Special handling for other operations allow_list = True allow_retrieve = True + allow_delete = True # Properties name = resource.prop('stack_name') diff --git a/openstack/tests/orchestration/v1/test_proxy.py b/openstack/tests/orchestration/v1/test_proxy.py index 361e878a..ebdb908d 100644 --- a/openstack/tests/orchestration/v1/test_proxy.py +++ b/openstack/tests/orchestration/v1/test_proxy.py @@ -30,3 +30,7 @@ class TestOrchestrationProxy(test_proxy_base.TestProxyBase): def test_stack_get(self): self.verify_get('openstack.orchestration.v1.stack.Stack.get', self.proxy.get_stack) + + def test_stack_delete(self): + self.verify_get('openstack.orchestration.v1.stack.Stack.delete', + self.proxy.delete_stack) diff --git a/openstack/tests/orchestration/v1/test_stack.py b/openstack/tests/orchestration/v1/test_stack.py index 4437d854..10ff0199 100644 --- a/openstack/tests/orchestration/v1/test_stack.py +++ b/openstack/tests/orchestration/v1/test_stack.py @@ -45,7 +45,7 @@ class TestStack(testtools.TestCase): self.assertFalse(sot.allow_create) self.assertTrue(sot.allow_retrieve) self.assertFalse(sot.allow_update) - self.assertFalse(sot.allow_delete) + self.assertTrue(sot.allow_delete) self.assertTrue(sot.allow_list) def test_make_it(self):