Fix SNS application endpoint to match AWS return format (#763)

This commit is contained in:
Mike Pappas 2016-11-11 17:01:47 -05:00 committed by Steve Pulec
commit 4942e74ab1
3 changed files with 13 additions and 0 deletions

View file

@ -120,6 +120,15 @@ class PlatformEndpoint(object):
self.attributes = attributes
self.id = uuid.uuid4()
self.messages = OrderedDict()
self.__fixup_attributes()
def __fixup_attributes(self):
# When AWS returns the attributes dict, it always contains these two elements, so we need to
# automatically ensure they exist as well.
if not 'Token' in self.attributes:
self.attributes['Token'] = self.token
if not 'Enabled' in self.attributes:
self.attributes['Enabled'] = True
@property
def arn(self):