diff options
author | Tim Bielawa <tbielawa@redhat.com> | 2016-08-29 11:06:14 -0700 |
---|---|---|
committer | Tim Bielawa <tbielawa@redhat.com> | 2016-09-01 12:00:47 -0700 |
commit | ce8b20890307717e26b48252fe70d0fd3e5b4685 (patch) | |
tree | 6e044bfc49c82b06da069d47208d3d94ecdd352b /utils/src | |
parent | 4538366d8e7533ef5b82b9d073fd0212e7321c0c (diff) | |
download | openshift-ce8b20890307717e26b48252fe70d0fd3e5b4685.tar.gz openshift-ce8b20890307717e26b48252fe70d0fd3e5b4685.tar.bz2 openshift-ce8b20890307717e26b48252fe70d0fd3e5b4685.tar.xz openshift-ce8b20890307717e26b48252fe70d0fd3e5b4685.zip |
Only prompt for proxy vars if none are set and our version recognizes them
Diffstat (limited to 'utils/src')
-rw-r--r-- | utils/src/ooinstall/cli_installer.py | 26 |
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 |