Merge in master.

This commit is contained in:
Steve Pulec 2017-03-05 09:58:39 -05:00
commit 3b4ef2cf15
26 changed files with 565 additions and 65 deletions

View file

@ -1,6 +1,7 @@
from __future__ import unicode_literals
from datetime import datetime
import json
import uuid
import boto.cloudformation
from moto.core import BaseBackend
@ -81,11 +82,10 @@ class FakeStack(object):
def stack_outputs(self):
return self.output_map.values()
def update(self, template, role_arn=None):
self._add_stack_event("UPDATE_IN_PROGRESS",
resource_status_reason="User Initiated")
def update(self, template, role_arn=None, parameters=None):
self._add_stack_event("UPDATE_IN_PROGRESS", resource_status_reason="User Initiated")
self.template = template
self.resource_map.update(json.loads(template))
self.resource_map.update(json.loads(template), parameters)
self.output_map = self._create_output_map()
self._add_stack_event("UPDATE_COMPLETE")
self.status = "UPDATE_COMPLETE"
@ -111,6 +111,7 @@ class FakeEvent(object):
self.resource_status_reason = resource_status_reason
self.resource_properties = resource_properties
self.timestamp = datetime.utcnow()
self.event_id = uuid.uuid4()
class CloudFormationBackend(BaseBackend):
@ -163,9 +164,9 @@ class CloudFormationBackend(BaseBackend):
if stack.name == name_or_stack_id:
return stack
def update_stack(self, name, template, role_arn=None):
def update_stack(self, name, template, role_arn=None, parameters=None):
stack = self.get_stack(name)
stack.update(template, role_arn)
stack.update(template, role_arn, parameters=parameters)
return stack
def list_stack_resources(self, stack_name_or_id):