summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-09-01 17:29:33 -0400
committerGitHub <noreply@github.com>2016-09-01 17:29:33 -0400
commitbdb4788982c71214b409b8db3ba2054305c851df (patch)
treeac9e92c97f6302b5b0685bd6146a290920efc049 /utils
parent16616b6978a1f32c5e70a5d5c140bdde9e7c3616 (diff)
parentce8b20890307717e26b48252fe70d0fd3e5b4685 (diff)
downloadopenshift-bdb4788982c71214b409b8db3ba2054305c851df.tar.gz
openshift-bdb4788982c71214b409b8db3ba2054305c851df.tar.bz2
openshift-bdb4788982c71214b409b8db3ba2054305c851df.tar.xz
openshift-bdb4788982c71214b409b8db3ba2054305c851df.zip
Merge pull request #2379 from tbielawa/FixBZ1339624
Fix bz1339624
Diffstat (limited to 'utils')
-rw-r--r--utils/src/ooinstall/cli_installer.py26
1 files changed, 22 insertions, 4 deletions
diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py
index 2ba7efe3e..dd17fbf89 100644
--- a/utils/src/ooinstall/cli_installer.py
+++ b/utils/src/ooinstall/cli_installer.py
@@ -555,8 +555,12 @@ def get_host_roles_set(oo_cfg):
def get_proxy_hostnames_and_excludes():
message = """
-If a proxy is needed to reach HTTP and HTTPS traffic, please enter the name below.
-This proxy will be configured by default for all processes that need to reach systems outside the cluster.
+If a proxy is needed to reach HTTP and HTTPS traffic, please enter the
+name below. This proxy will be configured by default for all processes
+that need to reach systems outside the cluster. An example proxy value
+would be:
+
+ http://proxy.example.com:8080/
More advanced configuration is possible if using Ansible directly:
@@ -567,6 +571,8 @@ https://docs.openshift.com/enterprise/latest/install_config/http_proxies.html
message = "Specify your http proxy ? (ENTER for none)"
http_proxy_hostname = click.prompt(message, default='')
+ # TODO: Fix this prompt message and behavior. 'ENTER' will default
+ # to the http_proxy_hostname if one was provided
message = "Specify your https proxy ? (ENTER for none)"
https_proxy_hostname = click.prompt(message, default=http_proxy_hostname)
@@ -632,11 +638,23 @@ https://docs.openshift.com/enterprise/latest/admin_guide/install/prerequisites.h
oo_cfg.deployment.variables['master_routingconfig_subdomain'] = get_master_routingconfig_subdomain()
click.clear()
+ # Are any proxy vars already presisted?
+ proxy_vars = ['proxy_exclude_hosts', 'proxy_https', 'proxy_http']
+ # Empty list if NO proxy vars were presisted
+ saved_proxy_vars = [pv for pv in proxy_vars
+ if oo_cfg.deployment.variables.get(pv, 'UNSET') is not 'UNSET']
+
+ installer_log.debug("Evaluated proxy settings, found %s presisted values",
+ len(saved_proxy_vars))
current_version = parse_version(
oo_cfg.settings.get('variant_version', '0.0'))
min_version = parse_version('3.2')
- if not oo_cfg.settings.get('openshift_http_proxy', None) and \
- current_version >= min_version:
+
+ # No proxy vars were saved and we are running a version which
+ # recognizes proxy parameters. We must prompt the user for values
+ # if this conditional is true.
+ if not saved_proxy_vars and current_version >= min_version:
+ installer_log.debug("Prompting user to enter proxy values")
http_proxy, https_proxy, proxy_excludes = get_proxy_hostnames_and_excludes()
oo_cfg.deployment.variables['proxy_http'] = http_proxy
oo_cfg.deployment.variables['proxy_https'] = https_proxy