diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-11-29 16:39:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-29 16:39:32 -0500 |
commit | e4a010aa08356e10fab9e9a4904dbd8491a74b8f (patch) | |
tree | d146f1e12c8efb25fac17eff70e5e38d8d7db511 /library | |
parent | f5a8207ad149fe8e67621b0b8fb585a48b3a1ca0 (diff) | |
parent | 81d8b6a835de79f18b2cae87b7b58ba4d02f0b14 (diff) | |
download | openshift-e4a010aa08356e10fab9e9a4904dbd8491a74b8f.tar.gz openshift-e4a010aa08356e10fab9e9a4904dbd8491a74b8f.tar.bz2 openshift-e4a010aa08356e10fab9e9a4904dbd8491a74b8f.tar.xz openshift-e4a010aa08356e10fab9e9a4904dbd8491a74b8f.zip |
Merge pull request #2855 from detiber/updateSchedulerDefaults
Update scheduler defaults
Diffstat (limited to 'library')
-rwxr-xr-x | library/modify_yaml.py | 9 | ||||
-rw-r--r-- | library/rpm_q.py | 8 |
2 files changed, 10 insertions, 7 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() diff --git a/library/rpm_q.py b/library/rpm_q.py index ca3d0dd89..3dec50fc2 100644 --- a/library/rpm_q.py +++ b/library/rpm_q.py @@ -9,7 +9,7 @@ available. """ # pylint: disable=redefined-builtin,wildcard-import,unused-wildcard-import -from ansible.module_utils.basic import * +from ansible.module_utils.basic import * # noqa: F403 DOCUMENTATION = """ --- @@ -35,16 +35,17 @@ EXAMPLES = """ RPM_BINARY = '/bin/rpm' + def main(): """ Checks rpm -q for the named package and returns the installed packages or None if not installed. """ - module = AnsibleModule( + module = AnsibleModule( # noqa: F405 argument_spec=dict( name=dict(required=True), state=dict(default='present', choices=['present', 'absent']) - ), + ), supports_check_mode=True ) @@ -66,5 +67,6 @@ def main(): else: module.fail_json(msg="%s is installed", installed_versions=installed) + if __name__ == '__main__': main() |