From 9ff149f77d2ad752422f6e56b9aac550068cacad Mon Sep 17 00:00:00 2001 From: Marcus Young Date: Tue, 15 May 2018 07:52:02 -0500 Subject: [PATCH] Add helpful message after success. Remove ssl warning when disabled --- fedcred/common.py | 2 ++ fedcred/providers/adfs.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/fedcred/common.py b/fedcred/common.py index a80cc9b..d5ceda7 100644 --- a/fedcred/common.py +++ b/fedcred/common.py @@ -169,3 +169,5 @@ def write_credentials(profile, creds): with open(aws_creds_path, 'w') as configfile: config.write(configfile) print('Credentials successfully written to %s' % (aws_creds_path)) + print('To make this work by default, run "export AWS_DEFAULT_PROFILE={}"'.format(profile)) + diff --git a/fedcred/providers/adfs.py b/fedcred/providers/adfs.py index ad6ca1e..fa699de 100644 --- a/fedcred/providers/adfs.py +++ b/fedcred/providers/adfs.py @@ -17,6 +17,9 @@ def __init__(self, config): try: self.sslverification = self.config.getboolean( common.DEFAULT_CONFIG_SECTION, 'sslverify') + if not self.sslverification: + from requests.packages.urllib3.exceptions import InsecureRequestWarning + requests.packages.urllib3.disable_warnings(InsecureRequestWarning) self.idpurl = self.config.get('adfs', 'url') self.domain = self.config.get('adfs', 'domain') try: