Fix flake8 failures (boo)

This commit is contained in:
Karl Gutwin 2018-11-09 09:32:19 -05:00
parent e7b01292e9
commit 46c0f8915f

View File

@ -406,8 +406,7 @@ class Table(BaseModel):
def set_stream_specification(self, streams):
self.stream_specification = streams
if streams and (streams.get('StreamEnabled')
or streams.get('StreamViewType')):
if streams and (streams.get('StreamEnabled') or streams.get('StreamViewType')):
self.stream_specification['StreamEnabled'] = True
self.latest_stream_label = datetime.datetime.utcnow().isoformat()
self.stream_shard = StreamShard(self)
@ -782,9 +781,7 @@ class DynamoDBBackend(BaseBackend):
def update_table_streams(self, name, stream_specification):
table = self.tables[name]
if ((stream_specification.get('StreamEnabled')
or stream_specification.get('StreamViewType'))
and table.latest_stream_label):
if (stream_specification.get('StreamEnabled') or stream_specification.get('StreamViewType')) and table.latest_stream_label:
raise ValueError('Table already has stream enabled')
table.set_stream_specification(stream_specification)
return table