diff options
-rwxr-xr-x | test/vcpe/vcpe.py | 6 | ||||
-rwxr-xr-x | test/vcpe/vcpecommon.py | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/test/vcpe/vcpe.py b/test/vcpe/vcpe.py index c768aa84d..bf6fcafbc 100755 --- a/test/vcpe/vcpe.py +++ b/test/vcpe/vcpe.py @@ -13,7 +13,13 @@ import vcpe_custom_service import csar_parser import config_sdnc_so import json +import urllib3 +# disable InsecureRequestWarning warning in requests < 2.16.0 +urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) +# disable InsecureRequestWarning warning in requests >= 2.16.0 +from requests.packages.urllib3.exceptions import InsecureRequestWarning +requests.packages.urllib3.disable_warnings(InsecureRequestWarning) def config_sniro(vcpecommon, vgmux_svc_instance_uuid, vbrg_svc_instance_uuid): logger = logging.getLogger(__name__) diff --git a/test/vcpe/vcpecommon.py b/test/vcpe/vcpecommon.py index 371029e19..7ce223ac9 100755 --- a/test/vcpe/vcpecommon.py +++ b/test/vcpe/vcpecommon.py @@ -369,7 +369,6 @@ class VcpeCommon: sys.exit(1) # Check policy already applied - requests.packages.urllib3.disable_warnings() policy_exists_req = requests.get(self.policy_pap_get_url.format( p_pap_cluster_ip), auth=self.policy_userpass, verify=False, headers=self.policy_headers) @@ -440,7 +439,6 @@ class VcpeCommon: self.hosts['aai-inst1'], self.aai_query_port, search_node_type, key, node_uuid) headers = {'Content-Type': 'application/json', 'Accept': 'application/json', 'X-FromAppID': 'vCPE-Robot', 'X-TransactionId': 'get_aai_subscr'} - requests.packages.urllib3.disable_warnings() r = requests.get(url, headers=headers, auth=self.aai_userpass, verify=False) response = r.json() self.logger.debug('aai query: ' + url) |