Add get_stack_template support for heat

This adds a function for fetching the template used by a heat stack.
We will use it to adopt an existing heat stack as a senlin node.

Change-Id: I2ddb9a8ccccc64589d5bca7942b687b2cf7ae5b9
Depends-On: Ic4ea1c58b8c43b2e4217b4a96195b338a3f4310b
This commit is contained in:
tengqm 2017-03-17 02:11:40 -04:00
parent 0cf912b4ec
commit 4151663cc5
2 changed files with 8 additions and 0 deletions

View File

@ -52,6 +52,10 @@ class HeatClient(base.DriverBase):
def stack_check(self, stack_id):
return self.conn.orchestration.check_stack(stack_id)
@sdk.translate_exception
def stack_get_template(self, stack_id):
return self.conn.orchestration.get_stack_template(stack_id)
@sdk.translate_exception
def wait_for_stack(self, stack_id, status, failures=None, interval=2,
timeout=None):

View File

@ -72,6 +72,10 @@ class TestHeatV1(base.SenlinTestCase):
self.hc.stack_check('stack_id')
self.orch.check_stack.assert_called_once_with('stack_id')
def test_stack_get_template(self):
self.hc.stack_get_template('stack_id')
self.orch.get_stack_template.assert_called_once_with('stack_id')
def test_wait_for_stack(self):
self.hc.wait_for_stack('FAKE_ID', 'STATUS', [], 100, 200)
self.orch.find_stack.assert_called_once_with('FAKE_ID', False)