diff options
author | Jason DeTiberus <jdetiber@redhat.com> | 2016-12-21 17:15:42 -0500 |
---|---|---|
committer | Jason DeTiberus <jdetiber@redhat.com> | 2017-01-10 11:45:30 -0500 |
commit | be949e0a0a2420205aaf80de514432a76596a854 (patch) | |
tree | be5edc6198f976215c1521a490d788f46b29e227 /roles/openshift_certificate_expiry | |
parent | 9d316d3091b28820e3840c535fc9bc4b6603ed72 (diff) | |
download | openshift-be949e0a0a2420205aaf80de514432a76596a854.tar.gz openshift-be949e0a0a2420205aaf80de514432a76596a854.tar.bz2 openshift-be949e0a0a2420205aaf80de514432a76596a854.tar.xz openshift-be949e0a0a2420205aaf80de514432a76596a854.zip |
More toxification
- Move pylint tests to tox
- Move yamllint tests to tox
- Create separate tox config (and setup.py) for root
- bump ansible requirement
- unify pylint config
- add docs
- remove git directory containing old testing tools
- install python-six if not present for openshift-facts
- add python-six as a dependency for openshift-ansible-utils
Diffstat (limited to 'roles/openshift_certificate_expiry')
-rw-r--r-- | roles/openshift_certificate_expiry/library/openshift_cert_expiry.py | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py index 7161b5277..a474b36b0 100644 --- a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py +++ b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py @@ -4,17 +4,13 @@ """For details on this module see DOCUMENTATION (below)""" -# router/registry cert grabbing -import subprocess -# etcd config file -import ConfigParser -# Expiration parsing import datetime -# File path stuff import os -# Config file parsing +import subprocess + +from six.moves import configparser + import yaml -# Certificate loading import OpenSSL.crypto DOCUMENTATION = ''' @@ -260,7 +256,10 @@ Return: # This is our module MAIN function after all, so there's bound to be a # lot of code bundled up into one block # -# pylint: disable=too-many-locals,too-many-locals,too-many-statements,too-many-branches +# Reason: These checks are disabled because the issue was introduced +# during a period where the pylint checks weren't enabled for this file +# Status: temporarily disabled pending future refactoring +# pylint: disable=too-many-locals,too-many-statements,too-many-branches def main(): """This module examines certificates (in various forms) which compose an OpenShift Container Platform cluster @@ -479,13 +478,17 @@ an OpenShift Container Platform cluster etcd_cert_params.append('dne') try: with open('/etc/etcd/etcd.conf', 'r') as fp: - etcd_config = ConfigParser.ConfigParser() + etcd_config = configparser.ConfigParser() + # Reason: This check is disabled because the issue was introduced + # during a period where the pylint checks weren't enabled for this file + # Status: temporarily disabled pending future refactoring + # pylint: disable=deprecated-method etcd_config.readfp(FakeSecHead(fp)) for param in etcd_cert_params: try: etcd_certs_to_check.add(etcd_config.get('ETCD', param)) - except ConfigParser.NoOptionError: + except configparser.NoOptionError: # That parameter does not exist, oh well... pass except IOError: |