X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fcollector%2Finfra_collectors%2Fvmware.py;h=09db0dbf9f892a4543923c59dc165d3fd0daaec9;hb=a84ec1f1cc94028173d4f028766eece6171cd0e7;hp=6547ab8c0c3fb3ad0416a5a24df6e26b4b43a264;hpb=0ccdba94d5ca1de0ff26c6aaf5a16aacc3c2fd0d;p=osm%2FMON.git diff --git a/osm_mon/collector/infra_collectors/vmware.py b/osm_mon/collector/infra_collectors/vmware.py index 6547ab8..09db0db 100644 --- a/osm_mon/collector/infra_collectors/vmware.py +++ b/osm_mon/collector/infra_collectors/vmware.py @@ -52,6 +52,7 @@ class VMwareInfraCollector(BaseVimInfraCollector): self.vim_uuid = vim_account["vim_uuid"] self.org_name = vim_account["orgname"] self.vim_project_id = vim_account["project_id"] + self.verify_ssl = vim_account.get("insecure", False) def connect_vim_as_admin(self): """Method connect as pvdc admin user to vCloud director. @@ -70,7 +71,7 @@ class VMwareInfraCollector(BaseVimInfraCollector): admin_user = self.admin_username admin_passwd = self.admin_password org = "System" - client = Client(host, verify_ssl_certs=False) + client = Client(host, verify_ssl_certs=self.verify_ssl) client.set_highest_supported_version() client.set_credentials(BasicLoginCredentials(admin_user, org, admin_passwd)) return client @@ -129,7 +130,9 @@ class VMwareInfraCollector(BaseVimInfraCollector): ], } - response = requests.get(url=url, headers=headers, verify=False) + response = requests.get( + url=url, headers=headers, verify=self.verify_ssl + ) if ( response.status_code != requests.codes.ok @@ -168,7 +171,9 @@ class VMwareInfraCollector(BaseVimInfraCollector): ], } - response = requests.get(url=url, headers=headers, verify=False) + response = requests.get( + url=url, headers=headers, verify=self.verify_ssl + ) if ( response.status_code != requests.codes.ok @@ -195,7 +200,9 @@ class VMwareInfraCollector(BaseVimInfraCollector): metrics.append(vim_status_metric) vnfrs = self.common_db.get_vnfrs(vim_account_id=vim_account_id) if self.conf.get("collector", "vm_infra_metrics"): - vm_infra_metrics_enabled = str(self.conf.get("collector", "vm_infra_metrics")).lower() in ("yes", "true", "1") + vm_infra_metrics_enabled = str( + self.conf.get("collector", "vm_infra_metrics") + ).lower() in ("yes", "true", "1") else: vm_infra_metrics_enabled = True if vm_infra_metrics_enabled: