import os
import yaml
-from .get_clouds_yaml_info import get_values_from_cloud, get_vim_values
+from get_clouds_yaml_info import get_values_from_cloud, get_vim_values
# Variables to be used by the testsuite
-vim_account_type = ""
-vim_name_prefix = ""
-vim_user = ""
-vim_password = ""
-vim_auth_url = ""
-vim_tenant = ""
-vim_config = ""
+VIM_ACCOUNT_TYPE = ""
+VIM_NAME_PREFIX = ""
+VIM_USER = ""
+VIM_PASSWORD = ""
+VIM_AUTH_URL = ""
+VIM_TENANT = ""
+VIM_CONFIG = ""
# VIM configuration
cloud_type = os.environ.get("CLOUD_TYPE", "openstack")
if cloud_type == "openstack":
# Openstack VIM
- vim_account_type = "openstack"
- vim_name_prefix = "basic01"
+ VIM_ACCOUNT_TYPE = "openstack"
+ VIM_NAME_PREFIX = "basic01"
# Get credentias from Openstack Clouds file
cloud, os_cloud = get_values_from_cloud()
(
- vim_user,
- vim_password,
- vim_auth_url,
- vim_tenant,
+ VIM_USER,
+ VIM_PASSWORD,
+ VIM_AUTH_URL,
+ VIM_TENANT,
vim_user_domain_name,
vim_project_domain_name,
vim_insecure,
vim_config_dict["user_domain_name"] = vim_user_domain_name
if vim_insecure:
vim_config_dict["insecure"] = True
- vim_config = "'{}'".format(
+ VIM_CONFIG = "'{}'".format(
yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip(
"\r\n"
)
elif cloud_type == "azure":
# Azure VIM
- vim_account_type = "azure"
- vim_name_prefix = "basic01"
- vim_auth_url = "http://www.azure.com"
- vim_user = os.environ.get("AZURE_CLIENT_ID")
- vim_password = os.environ.get("AZURE_SECRET")
- vim_tenant = os.environ.get("AZURE_TENANT")
+ VIM_ACCOUNT_TYPE = "azure"
+ VIM_NAME_PREFIX = "basic01"
+ VIM_AUTH_URL = "http://www.azure.com"
+ VIM_USER = os.environ.get("AZURE_CLIENT_ID")
+ VIM_PASSWORD = os.environ.get("AZURE_SECRET")
+ VIM_TENANT = os.environ.get("AZURE_TENANT")
# Extra config
vim_config_dict = {}
vim_config_dict["vnet_name"] = os.environ.get("VNET_NAME")
if "AZURE_FLAVORS_PATTERN" in os.environ:
vim_config_dict["flavors_pattern"] = os.environ.get("AZURE_FLAVORS_PATTERN")
- vim_config = "'{}'".format(
+ VIM_CONFIG = "'{}'".format(
yaml.safe_dump(vim_config_dict, default_flow_style=True, width=10000).rstrip(
"\r\n"
)