[fix gate] Fix pep8 errors

Fix failing pep8 errors which were never being flagged but now are,
possibly due to changes in flake8 rules. This patchset corrects
the following errors:

./deckhand/engine/layering.py:567:21: W503 line break before binary operator
./deckhand/engine/secrets_manager.py:406:33: W503 line break before binary operator
./deckhand/engine/utils.py:33:17: W503 line break before binary operator
./deckhand/common/utils.py:292:17: W503 line break before binary operator

Change-Id: Ic26aecb6b8049e138a826af9953f45298e817795
This commit is contained in:
Felipe Monteiro 2018-05-09 02:14:08 +01:00
parent 8538ff5671
commit 97578a933f
4 changed files with 8 additions and 8 deletions

View File

@ -288,8 +288,8 @@ def deepfilter(dct, **filters):
# Else if both the filter value and the actual value in the doc # Else if both the filter value and the actual value in the doc
# are dictionaries, check whether the filter dict is a subset # are dictionaries, check whether the filter dict is a subset
# of the actual dict. # of the actual dict.
if (isinstance(actual_val, dict) if (isinstance(actual_val, dict) and
and isinstance(filter_val, dict)): isinstance(filter_val, dict)):
is_subset = set( is_subset = set(
filter_val.items()).issubset(set(actual_val.items())) filter_val.items()).issubset(set(actual_val.items()))
if not is_subset: if not is_subset:

View File

@ -563,8 +563,8 @@ class DocumentLayering(object):
parent_name=overall_data.name, parent_name=overall_data.name,
action=action) action=action)
if (isinstance(from_parent, dict) if (isinstance(from_parent, dict) and
and isinstance(from_child, dict)): isinstance(from_child, dict)):
engine_utils.deep_merge(from_parent, from_child) engine_utils.deep_merge(from_parent, from_child)
if from_parent is not None: if from_parent is not None:

View File

@ -402,8 +402,8 @@ class SecretsSubstitution(object):
substituted_data = utils.jsonpath_replace( substituted_data = utils.jsonpath_replace(
document['data'], src_secret, document['data'], src_secret,
dest_path, dest_pattern) dest_path, dest_pattern)
if (isinstance(document['data'], dict) if (isinstance(document['data'], dict) and
and isinstance(substituted_data, dict)): isinstance(substituted_data, dict)):
document['data'].update(substituted_data) document['data'].update(substituted_data)
elif substituted_data: elif substituted_data:
document['data'] = substituted_data document['data'] = substituted_data

View File

@ -29,8 +29,8 @@ def deep_merge(dct, merge_dct):
:return: None :return: None
""" """
for k, v in merge_dct.items(): for k, v in merge_dct.items():
if (k in dct and isinstance(dct[k], dict) if (k in dct and isinstance(dct[k], dict) and
and isinstance(merge_dct[k], collections.Mapping)): isinstance(merge_dct[k], collections.Mapping)):
deep_merge(dct[k], merge_dct[k]) deep_merge(dct[k], merge_dct[k])
else: else:
dct[k] = merge_dct[k] dct[k] = merge_dct[k]