diff --git a/art/_config.py b/art/_config.py index 62ee505..94358d4 100644 --- a/art/_config.py +++ b/art/_config.py @@ -8,10 +8,11 @@ from . import _yaml -def save(gitlab_url, private_token): +def save(gitlab_url, private_token, verify_ssl): config = { 'gitlab_url': gitlab_url, - 'auth_header': {'PRIVATE-TOKEN': private_token} + 'auth_header': {'PRIVATE-TOKEN': private_token}, + 'verify_ssl': verify_ssl } _paths.mkdirs(os.path.dirname(_paths.config_file)) _yaml.save(_paths.config_file, config) diff --git a/art/_gitlab.py b/art/_gitlab.py index f19794d..1bbd568 100644 --- a/art/_gitlab.py +++ b/art/_gitlab.py @@ -9,12 +9,13 @@ def quote(url): class Gitlab(object): - def __init__(self, gitlab_url, auth_header): + def __init__(self, gitlab_url, auth_header, verify_ssl): self.api_url = gitlab_url + '/api/v3' self.headers = auth_header + self.verify = False if verify_ssl == 'False' else True def _get(self, request, *args, **kwargs): - r = requests.get(self.api_url + request % args, headers=self.headers, **kwargs) + r = requests.get(self.api_url + request % args, headers=self.headers, verify=self.verify, **kwargs) r.raise_for_status() return r diff --git a/art/command_line.py b/art/command_line.py index 0ed965f..610a0c7 100644 --- a/art/command_line.py +++ b/art/command_line.py @@ -30,6 +30,7 @@ def main(cache): @main.command() @click.argument('gitlab_url') @click.argument('private_token') +@click.argument('verify_ssl') def configure(**kwargs): """Configure Gitlab URL and access token."""