Get a stack

Change-Id: I3410cce0022658701d8234ff0e003e05b1cd566f
This commit is contained in:
Everett Toews
2015-02-05 19:30:23 -06:00
parent 3182212674
commit fa6da9618d
4 changed files with 11 additions and 3 deletions

View File

@@ -23,3 +23,6 @@ class Proxy(object):
def list_stacks(self):
return stack.Stack.list(self.session)
def get_stack(self, **data):
return stack.Stack(data).get(self.session)

View File

@@ -23,8 +23,10 @@ class Stack(resource.Resource):
# capabilities
# NOTE(thowe): Special handling for other operations
allow_list = True
allow_retrieve = True
# Properties
name = resource.prop('stack_name')
capabilities = resource.prop('capabilities')
creation_time = resource.prop('creation_time')
description = resource.prop('description')
@@ -33,7 +35,6 @@ class Stack(resource.Resource):
notification_topics = resource.prop('notification_topics')
outputs = resource.prop('outputs')
parameters = resource.prop('parameters', type=dict)
stack_name = resource.prop('stack_name')
stack_status = resource.prop('stack_status')
stack_status_reason = resource.prop('stack_status_reason')
template_description = resource.prop('template_description')

View File

@@ -26,3 +26,7 @@ class TestOrchestrationProxy(test_proxy_base.TestProxyBase):
def test_stack_list(self):
self.verify_list('openstack.orchestration.v1.stack.Stack.list',
self.proxy.list_stacks)
def test_stack_get(self):
self.verify_get('openstack.orchestration.v1.stack.Stack.get',
self.proxy.get_stack)

View File

@@ -43,7 +43,7 @@ class TestStack(testtools.TestCase):
self.assertEqual('/stacks', sot.base_path)
self.assertEqual('orchestration', sot.service.service_type)
self.assertFalse(sot.allow_create)
self.assertFalse(sot.allow_retrieve)
self.assertTrue(sot.allow_retrieve)
self.assertFalse(sot.allow_update)
self.assertFalse(sot.allow_delete)
self.assertTrue(sot.allow_list)
@@ -60,7 +60,7 @@ class TestStack(testtools.TestCase):
sot.notification_topics)
self.assertEqual(EXAMPLE['outputs'], sot.outputs)
self.assertEqual(EXAMPLE['parameters'], sot.parameters)
self.assertEqual(EXAMPLE['stack_name'], sot.stack_name)
self.assertEqual(EXAMPLE['stack_name'], sot.name)
self.assertEqual(EXAMPLE['stack_status'], sot.stack_status)
self.assertEqual(EXAMPLE['stack_status_reason'],
sot.stack_status_reason)