Skip to content
This repository has been archived by the owner on Sep 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #711 from wainaxman/master
Browse files Browse the repository at this point in the history
Adding insecure flag to CONFIG_PARAM_TYPE in conf.py
  • Loading branch information
AlanCoding authored Jul 9, 2019
2 parents 2f03c42 + 81099b6 commit 5363e79
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tower_cli/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import contextlib
import copy
import functools
import json
import os
import stat
import warnings

Expand Down Expand Up @@ -139,7 +139,7 @@ def __init__(self):
def _make_request(self, method, url, args, kwargs):
# Decide whether to require SSL verification
verify_ssl = True
if (settings.verify_ssl is False) or hasattr(settings, 'insecure'):
if (settings.verify_ssl is False) or (settings.insecure is True):
verify_ssl = False
elif settings.certificate:
verify_ssl = settings.certificate
Expand Down
22 changes: 12 additions & 10 deletions tower_cli/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,18 @@
user_dir = os.path.expanduser('~')
CONFIG_FILENAME = '.tower_cli.cfg'
CONFIG_PARAM_TYPE = {
'host': click.STRING,
'username': click.STRING,
'password': click.STRING,
'verify_ssl': click.BOOL,
'format': click.Choice,
'certificate': click.STRING,
'color': click.BOOL,
'verbose': click.BOOL,
'description_on': click.BOOL,
'certificate': click.STRING,
'format': click.Choice,
'host': click.STRING,
'insecure': click.BOOL,
'oauth_token': click.STRING,
'password': click.STRING,
'use_token': click.BOOL,
'oauth_token': click.STRING
'username': click.STRING,
'verbose': click.BOOL,
'verify_ssl': click.BOOL
}

CONFIG_OPTIONS = frozenset(CONFIG_PARAM_TYPE.keys())
Expand Down Expand Up @@ -136,12 +137,13 @@ def __init__(self):
defaults[key] = ''
defaults.update({
'color': 'true',
'description_on': 'false',
'format': 'human',
'host': '127.0.0.1',
'insecure': 'false',
'use_token': 'false',
'verify_ssl': 'true',
'verbose': 'false',
'description_on': 'false',
'use_token': 'false',
})
self._defaults = self._new_parser(defaults=defaults)

Expand Down

0 comments on commit 5363e79

Please sign in to comment.