From 75c752d08f63852db6ba4df5f2c4380ba4bcbdc8 Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Mon, 15 May 2017 15:48:46 -0400 Subject: Filter non-strings from the oc_adm_ca_server_cert hostnames parameter. This allows the omit filter to be used in the hostnames parameter list which simplifies conditionally added hostnames. --- roles/lib_openshift/library/oc_adm_ca_server_cert.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'roles/lib_openshift/library') diff --git a/roles/lib_openshift/library/oc_adm_ca_server_cert.py b/roles/lib_openshift/library/oc_adm_ca_server_cert.py index 03d3e17c4..a6273cfe4 100644 --- a/roles/lib_openshift/library/oc_adm_ca_server_cert.py +++ b/roles/lib_openshift/library/oc_adm_ca_server_cert.py @@ -1534,6 +1534,10 @@ class CAServerCert(OpenShiftCLI): def run_ansible(params, check_mode): '''run the idempotent ansible code''' + # Filter non-strings from hostnames list s.t. the omit filter + # may be used to conditionally add a hostname. + params['hostnames'] = [host for host in params['hostnames'] if isinstance(host, string_types)] + config = CAServerCertConfig(params['kubeconfig'], params['debug'], {'cert': {'value': params['cert'], 'include': True}, @@ -1583,6 +1587,10 @@ class CAServerCert(OpenShiftCLI): # -*- -*- -*- Begin included fragment: ansible/oc_adm_ca_server_cert.py -*- -*- -*- + +# pylint: disable=wrong-import-position +from ansible.module_utils.six import string_types + def main(): ''' ansible oc adm module for ca create-server-cert -- cgit v1.2.3