summaryrefslogtreecommitdiffstats
path: root/library/modify_yaml.py
diff options
context:
space:
mode:
authorJason DeTiberus <jdetiber@redhat.com>2016-11-28 15:32:46 -0500
committerJason DeTiberus <jdetiber@redhat.com>2016-11-29 12:41:14 -0500
commitcef42e2541f7ddeaf284b1350eed7f4e46234fe9 (patch)
treeec51eb6d9dc1d48daf336054ea5688e0f3107f13 /library/modify_yaml.py
parente5f352d6f7c7bd91c2784152a8805f6e22f407db (diff)
downloadopenshift-cef42e2541f7ddeaf284b1350eed7f4e46234fe9.tar.gz
openshift-cef42e2541f7ddeaf284b1350eed7f4e46234fe9.tar.bz2
openshift-cef42e2541f7ddeaf284b1350eed7f4e46234fe9.tar.xz
openshift-cef42e2541f7ddeaf284b1350eed7f4e46234fe9.zip
update tests and flake8/pylint fixes
Diffstat (limited to 'library/modify_yaml.py')
-rwxr-xr-xlibrary/modify_yaml.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/library/modify_yaml.py b/library/modify_yaml.py
index 63b507a72..000c7d9a2 100755
--- a/library/modify_yaml.py
+++ b/library/modify_yaml.py
@@ -30,7 +30,7 @@ def set_key(yaml_data, yaml_key, yaml_value):
ptr[key] = {}
ptr = ptr[key]
elif key == yaml_key.split('.')[-1]:
- if (key in ptr and module.safe_eval(ptr[key]) != yaml_value) or (key not in ptr):
+ if (key in ptr and module.safe_eval(ptr[key]) != yaml_value) or (key not in ptr): # noqa: F405
ptr[key] = yaml_value
changes.append((yaml_key, yaml_value))
else:
@@ -49,7 +49,7 @@ def main():
# redefined-outer-name
global module
- module = AnsibleModule(
+ module = AnsibleModule( # noqa: F405
argument_spec=dict(
dest=dict(required=True),
yaml_key=dict(required=True),
@@ -94,10 +94,11 @@ def main():
except Exception, e:
return module.fail_json(msg=str(e))
+
# ignore pylint errors related to the module_utils import
-# pylint: disable=redefined-builtin, unused-wildcard-import, wildcard-import
+# pylint: disable=redefined-builtin, unused-wildcard-import, wildcard-import, wrong-import-position
# import module snippets
-from ansible.module_utils.basic import *
+from ansible.module_utils.basic import * # noqa: F402,F403
if __name__ == '__main__':
main()