X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcollector%2Fvnf_collectors%2Fvrops%2Fvrops_helper.py;h=eadd5c7d21d164a37cf9916e3041496737b5554a;hb=HEAD;hp=8164510c764d25456d44f072387fc635f18aab43;hpb=56ae1cf6936ebbf6a25f3abb612495d5c3a4adb0;p=osm%2FMON.git diff --git a/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py b/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py index 8164510..eadd5c7 100644 --- a/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py +++ b/osm_mon/collector/vnf_collectors/vrops/vrops_helper.py @@ -44,10 +44,17 @@ METRIC_MULTIPLIERS = { class vROPS_Helper: - def __init__(self, vrops_site="https://vrops", vrops_user="", vrops_password=""): + def __init__( + self, + vrops_site="https://vrops", + vrops_user="", + vrops_password="", + verify_ssl=False, + ): self.vrops_site = vrops_site self.vrops_user = vrops_user self.vrops_password = vrops_password + self.verify_ssl = verify_ssl def get_vrops_token(self): """Fetches token from vrops""" @@ -55,7 +62,10 @@ class vROPS_Helper: headers = {"Content-Type": "application/json", "Accept": "application/json"} req_body = {"username": self.vrops_user, "password": self.vrops_password} resp = requests.post( - self.vrops_site + auth_url, json=req_body, verify=False, headers=headers + self.vrops_site + auth_url, + json=req_body, + verify=self.verify_ssl, + headers=headers, ) if resp.status_code != 200: log.error( @@ -78,7 +88,9 @@ class vROPS_Helper: } resource_list = [] - resp = requests.get(self.vrops_site + api_url, verify=False, headers=headers) + resp = requests.get( + self.vrops_site + api_url, verify=self.verify_ssl, headers=headers + ) if resp.status_code != 200: log.error( @@ -144,7 +156,7 @@ class vROPS_Helper: } resp = requests.get( - self.vrops_site + api_url, verify=False, headers=headers + self.vrops_site + api_url, verify=self.verify_ssl, headers=headers ) if resp.status_code != 200: