import os
from pathlib import Path
import yaml
-from common_helpers import get_prometheus_info
-# Prometheus host and port
-(
- prometheus_host,
- prometheus_port,
- prometheus_user,
- prometheus_password,
-) = get_prometheus_info()
-
# VIM configuration
cloud_type = os.environ.get("CLOUD_TYPE", "openstack")
if cloud_type == "openstack":
raise Exception("Openstack clouds file not found")
with clouds_file_path.open() as clouds_file:
clouds = yaml.safe_load(clouds_file)
- if not os_cloud in clouds["clouds"]:
+ if os_cloud not in clouds["clouds"]:
raise Exception("Openstack cloud '" + os_cloud + "' not found")
cloud = clouds["clouds"][os_cloud]
- if not "username" in cloud["auth"]:
+ if "username" not in cloud["auth"]:
raise Exception("Username not found in Openstack cloud '" + os_cloud + "'")
vim_user = cloud["auth"]["username"]
- if not "password" in cloud["auth"]:
+ if "password" not in cloud["auth"]:
raise Exception("Password not found in Openstack cloud '" + os_cloud + "'")
vim_password = cloud["auth"]["password"]
- if not "auth_url" in cloud["auth"]:
+ if "auth_url" not in cloud["auth"]:
raise Exception("Auth url not found in Openstack cloud '" + os_cloud + "'")
vim_auth_url = cloud["auth"]["auth_url"]
- if not "project_name" in cloud["auth"]:
+ if "project_name" not in cloud["auth"]:
raise Exception(
"Project name not found in Openstack cloud '" + os_cloud + "'"
)