Skip to content

Commit 6ff3605

Browse files
Lauren Frederickwhummer
authored andcommitted
PR fixes and more lint error fixes
1 parent 33eb9d1 commit 6ff3605

3 files changed

Lines changed: 9 additions & 11 deletions

File tree

localstack/services/awslambda/lambda_api.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,9 +964,7 @@ def update_event_source_mapping(mapping_uuid):
964964
if not mapping_uuid:
965965
return jsonify({})
966966
function_name = data.get('FunctionName') or ''
967-
enabled = data.get('Enabled')
968-
if enabled is None:
969-
enabled = True
967+
enabled = data.get('Enabled', True)
970968
batch_size = data.get('BatchSize') or 100
971969
mapping = update_event_source(mapping_uuid, function_name, enabled, batch_size)
972970
return jsonify(mapping)

localstack/services/awslambda/lambda_executors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def get_docker_container_status(self, func_arn):
420420
# Check if the container is already running
421421
# Note: filtering by *exact* name using regex filter '^...$' seems unstable on some
422422
# systems. Therefore, we use a combination of filter and grep to get the results.
423-
cmd = ('docker ps -a --filter name=\'%s\' '
423+
cmd = ("docker ps -a --filter name='%s' "
424424
'--format "{{ .Status }} - {{ .Names }}" '
425425
'| grep -w "%s" | cat') % (container_name, container_name)
426426
LOG.debug('Getting status for container "%s": %s' % (container_name, cmd))

tests/unit/test_sns_listener.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_filter_policy():
170170
(
171171
'exact string filter on an array',
172172
{'filter': 'soccer'},
173-
{'filter': {'Type': 'String.Array', 'Value': '[\'soccer\', \'rugby\', \'hockey\']'}},
173+
{'filter': {'Type': 'String.Array', 'Value': "['soccer', 'rugby', 'hockey']"}},
174174
True
175175
),
176176
(
@@ -200,7 +200,7 @@ def test_filter_policy():
200200
(
201201
'or string filter match with an array',
202202
{'filter': ['soccer', 'basketball']},
203-
{'filter': {'Type': 'String.Array', 'Value': '[\'soccer\', \'rugby\', \'hockey\']'}},
203+
{'filter': {'Type': 'String.Array', 'Value': "['soccer', 'rugby', 'hockey']"}},
204204
True
205205
),
206206
(
@@ -218,7 +218,7 @@ def test_filter_policy():
218218
(
219219
'or string filter no match with an array',
220220
{'filter': ['volleyball', 'basketball']},
221-
{'filter': {'Type': 'String.Array', 'Value': '[\'soccer\', \'rugby\', \'hockey\']'}},
221+
{'filter': {'Type': 'String.Array', 'Value': "['soccer', 'rugby', 'hockey']"}},
222222
False
223223
),
224224
(
@@ -242,7 +242,7 @@ def test_filter_policy():
242242
(
243243
'prefix string filter match with an array',
244244
{'filter': [{'prefix': 'soc'}]},
245-
{'filter': {'Type': 'String.Array', 'Value': '[\'soccer\', \'rugby\', \'hockey\']'}},
245+
{'filter': {'Type': 'String.Array', 'Value': "['soccer', 'rugby', 'hockey']"}},
246246
True
247247
),
248248
(
@@ -332,7 +332,7 @@ def test_filter_policy():
332332
(
333333
'logical OR with match on an array',
334334
{'filter': ['test1', 'test2', {'prefix': 'typ'}]},
335-
{'filter': {'Type': 'String.Array', 'Value': '[\'test1\', \'other\']'}},
335+
{'filter': {'Type': 'String.Array', 'Value': "['test1', 'other']"}},
336336
True
337337
),
338338
(
@@ -344,7 +344,7 @@ def test_filter_policy():
344344
(
345345
'logical OR no match on an array',
346346
{'filter': ['test1', 'test2', {'prefix': 'typ'}]},
347-
{'filter': {'Type': 'String.Array', 'Value': '[\'anything\', \'something\']'}},
347+
{'filter': {'Type': 'String.Array', 'Value': "['anything', 'something']"}},
348348
False
349349
),
350350
(
@@ -422,7 +422,7 @@ def test_filter_policy():
422422
(
423423
'multiple conditions on an array',
424424
{'filter': ['test1', 'test2', {'prefix': 'som'}]},
425-
{'filter': {'Type': 'String.Array', 'Value': '[\'anything\', \'something\']'}},
425+
{'filter': {'Type': 'String.Array', 'Value': "['anything', 'something']"}},
426426
True
427427
)
428428
]

0 commit comments

Comments
 (0)