diff options
Diffstat (limited to 'roles/lib_openshift/src')
-rw-r--r-- | roles/lib_openshift/src/lib/base.py | 3 | ||||
-rwxr-xr-x | roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/roles/lib_openshift/src/lib/base.py b/roles/lib_openshift/src/lib/base.py index 0b37862c9..7d4775229 100644 --- a/roles/lib_openshift/src/lib/base.py +++ b/roles/lib_openshift/src/lib/base.py @@ -295,10 +295,12 @@ class Utils(object): tmp = Utils.create_tmpfile(prefix=rname) if ftype == 'yaml': + # pylint: disable=no-member if hasattr(yaml, 'RoundTripDumper'): Utils._write(tmp, yaml.dump(data, Dumper=yaml.RoundTripDumper)) else: Utils._write(tmp, yaml.safe_dump(data, default_flow_style=False)) + elif ftype == 'json': Utils._write(tmp, json.dumps(data)) else: @@ -380,6 +382,7 @@ class Utils(object): contents = sfd.read() if sfile_type == 'yaml': + # pylint: disable=no-member if hasattr(yaml, 'RoundTripLoader'): contents = yaml.load(contents, yaml.RoundTripLoader) else: diff --git a/roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py b/roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py index 1eb7dd3be..213c581aa 100755 --- a/roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py +++ b/roles/lib_openshift/src/test/unit/oc_serviceaccount_secret.py @@ -26,10 +26,10 @@ sys.path.insert(0, module_path) from oc_serviceaccount_secret import OCServiceAccountSecret # noqa: E402 try: - import ruamel.yaml as yaml - YAML_TYPE='ruamel' + import ruamel.yaml as yaml # noqa: EF401 + YAML_TYPE = 'ruamel' except ImportError: - YAML_TYPE='pyyaml' + YAML_TYPE = 'pyyaml' class OCServiceAccountSecretTest(unittest.TestCase): |