From 2e37c702c8d4c3778d172d8e886f68e23d4aeebc Mon Sep 17 00:00:00 2001 From: Jason DeTiberus Date: Thu, 9 Mar 2017 12:38:36 -0500 Subject: Use six from ansible.module_utils for remote hosts --- filter_plugins/oo_filters.py | 2 +- roles/openshift_certificate_expiry/library/openshift_cert_expiry.py | 2 +- roles/openshift_facts/library/openshift_facts.py | 4 ++-- roles/openshift_facts/vars/main.yml | 1 - roles/openshift_health_checker/openshift_checks/__init__.py | 5 ++--- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index ed6923687..5b5c4889a 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -18,9 +18,9 @@ from collections import Mapping from distutils.util import strtobool from distutils.version import LooseVersion from operator import itemgetter -from ansible.module_utils.six.moves.urllib.parse import urlparse from ansible.parsing.yaml.dumper import AnsibleDumper from six import string_types +from six.moves.urllib.parse import urlparse HAS_OPENSSL = False try: diff --git a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py index 33a4faf3e..78e8747ed 100644 --- a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py +++ b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py @@ -10,7 +10,7 @@ import os import subprocess import yaml -from six.moves import configparser +from ansible.module_utils.six.moves import configparser from ansible.module_utils.basic import AnsibleModule diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 8ea900e21..eeab8a99c 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -19,8 +19,8 @@ import struct import socket from distutils.util import strtobool from distutils.version import LooseVersion -from six import string_types, text_type -from six.moves import configparser +from ansible.module_utils.six import string_types, text_type +from ansible.module_utils.six.moves import configparser # ignore pylint errors related to the module_utils import # pylint: disable=redefined-builtin, unused-wildcard-import, wildcard-import diff --git a/roles/openshift_facts/vars/main.yml b/roles/openshift_facts/vars/main.yml index 07f5100ad..053a4cfc8 100644 --- a/roles/openshift_facts/vars/main.yml +++ b/roles/openshift_facts/vars/main.yml @@ -2,7 +2,6 @@ required_packages: - iproute - python-dbus - - python-six - PyYAML - yum-utils diff --git a/roles/openshift_health_checker/openshift_checks/__init__.py b/roles/openshift_health_checker/openshift_checks/__init__.py index 2c70438c9..b410574a6 100644 --- a/roles/openshift_health_checker/openshift_checks/__init__.py +++ b/roles/openshift_health_checker/openshift_checks/__init__.py @@ -7,8 +7,7 @@ from abc import ABCMeta, abstractmethod, abstractproperty from importlib import import_module import operator -import six -from six.moves import reduce +from ansible.module_utils.six.moves import add_metaclass, reduce class OpenShiftCheckException(Exception): @@ -16,7 +15,7 @@ class OpenShiftCheckException(Exception): pass -@six.add_metaclass(ABCMeta) +@add_metaclass(ABCMeta) class OpenShiftCheck(object): """A base class for defining checks for an OpenShift cluster environment.""" -- cgit v1.2.3