def test_adopt_stack_fails(self):
    adopt_data = '{\n                "action": "CREATE",\n                "status": "COMPLETE",\n                "name": "my-test-stack-name",\n                "resources": {}\n                }'
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    self.stack = stack.Stack(utils.dummy_context(), 'test_stack', tmpl, adopt_stack_data=json.loads(adopt_data))
    self.stack.store()
    self.stack.adopt()
    self.assertEqual((self.stack.ADOPT, self.stack.FAILED), self.stack.state)
    expected = 'Resource ADOPT failed: Exception: resources.foo: Resource ID was not provided.'
    self.assertEqual(expected, self.stack.status_reason)
def test_adopt_stack_fails(self):
    adopt_data = '{\n                "action": "CREATE",\n                "status": "COMPLETE",\n                "name": "my-test-stack-name",\n                "resources": {}\n                }'
    tmpl = template.Template({'HeatTemplateFormatVersion': '2012-12-12', 'Resources': {'foo': {'Type': 'GenericResourceType'}}})
    self.stack = stack.Stack(utils.dummy_context(), 'test_stack', tmpl, adopt_stack_data=json.loads(adopt_data))
    self.stack.store()
    self.stack.adopt()
    self.assertEqual((self.stack.ADOPT, self.stack.FAILED), self.stack.state)
    expected = 'Resource ADOPT failed: Exception: resources.foo: Resource ID was not provided.'
    self.assertEqual(expected, self.stack.status_reason)