From 9b0d793eadddf290388239b167cdf83142a36c78 Mon Sep 17 00:00:00 2001 From: Andrew Butcher Date: Mon, 8 Aug 2016 15:31:08 -0400 Subject: Try/except urlparse calls. --- roles/openshift_facts/library/openshift_facts.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 659f4eba6..afa2626f9 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -944,7 +944,11 @@ def format_url(use_ssl, hostname, port, path=''): netloc = hostname if (use_ssl and port != '443') or (not use_ssl and port != '80'): netloc += ":%s" % port - return urlparse.urlunparse((scheme, netloc, path, '', '', '')) + try: + url = urlparse.urlunparse((scheme, netloc, path, '', '', '')) + except AttributeError: + url = urlunparse((scheme, netloc, path, '', '', '')) + return url def get_current_config(facts): """ Get current openshift config -- cgit v1.2.3