Add init loop in prometheus sidecar container
[osm/devops.git] / systest / lib / vim / vim.py
index 98bda38..0ac9525 100644 (file)
@@ -18,9 +18,12 @@ from osmclient.common.exceptions import ClientException
 
 
 class Vim():
-    def __init__(self,osm,openstack):
+    def __init__(self,osm,openstack,vmware):
         self.vim_name='pytest'
         try:
             osm.get_api().vim.get(self.vim_name)
         except ClientException:
-            osm.get_api().vim.create(self.vim_name,openstack.get_access())
+            if vmware._os_access['vim-url'] and vmware._os_access['vim-type'] == 'vmware':
+                osm.get_api().vim.create(self.vim_name,vmware.get_access())
+            else:
+                osm.get_api().vim.create(self.vim_name,openstack.get_access())