Fix missing ignore_certs (#16018)

This commit is contained in:
Chris Houseknecht 2016-05-27 09:39:00 -04:00 committed by Brian Coca
parent 2399dd32a8
commit 0de111be00
3 changed files with 7 additions and 14 deletions

View file

@ -129,10 +129,10 @@ class GalaxyCLI(CLI):
'The default is the roles_path configured in your ' 'The default is the roles_path configured in your '
'ansible.cfg file (/etc/ansible/roles if not configured)') 'ansible.cfg file (/etc/ansible/roles if not configured)')
if self.action in ("import","info","init","install","login","search","setup","delete"):
self.parser.add_option('-s', '--server', dest='api_server', default=C.GALAXY_SERVER, self.parser.add_option('-s', '--server', dest='api_server', default=C.GALAXY_SERVER,
help='The API server destination') help='The API server destination')
self.parser.add_option('-c', '--ignore-certs', action='store_true', dest='ignore_certs', default=False,
self.parser.add_option('-c', '--ignore-certs', action='store_true', dest='ignore_certs', default=C.GALAXY_IGNORE_CERTS,
help='Ignore SSL certificate validation errors.') help='Ignore SSL certificate validation errors.')
if self.action in ("init","install"): if self.action in ("init","install"):

View file

@ -65,14 +65,11 @@ class GalaxyAPI(object):
self.galaxy = galaxy self.galaxy = galaxy
self.token = GalaxyToken() self.token = GalaxyToken()
self._api_server = C.GALAXY_SERVER self._api_server = C.GALAXY_SERVER
self._validate_certs = not C.GALAXY_IGNORE_CERTS self._validate_certs = not galaxy.options.ignore_certs
self.baseurl = None self.baseurl = None
self.version = None self.version = None
self.initialized = False self.initialized = False
# set validate_certs
if galaxy.options.ignore_certs:
self._validate_certs = False
display.vvv('Validate TLS certificates: %s' % self._validate_certs) display.vvv('Validate TLS certificates: %s' % self._validate_certs)
# set the API server # set the API server

View file

@ -54,12 +54,8 @@ class GalaxyRole(object):
self._metadata = None self._metadata = None
self._install_info = None self._install_info = None
self._validate_certs = not galaxy.options.ignore_certs
self._validate_certs = not C.GALAXY_IGNORE_CERTS
# set validate_certs
if galaxy.options.ignore_certs:
self._validate_certs = False
display.vvv('Validate TLS certificates: %s' % self._validate_certs) display.vvv('Validate TLS certificates: %s' % self._validate_certs)
self.options = galaxy.options self.options = galaxy.options