From 36cc2313e7afa8ee163f76cebbbd9c85847097e1 Mon Sep 17 00:00:00 2001 From: vktrrdk Date: Thu, 11 Jan 2024 15:02:26 +0000 Subject: [PATCH] fix(OpenStack): Ability to set certain Compute-API version to evade undesirable behavior --- simple_vm_client/openstack_connector/openstack_connector.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/simple_vm_client/openstack_connector/openstack_connector.py b/simple_vm_client/openstack_connector/openstack_connector.py index 23d4ed5..d73e947 100644 --- a/simple_vm_client/openstack_connector/openstack_connector.py +++ b/simple_vm_client/openstack_connector/openstack_connector.py @@ -77,6 +77,7 @@ def __init__(self, config_file: str): self.APPLICATION_CREDENTIAL_ID = "" self.APPLICATION_CREDENTIAL_SECRET = "" self.USE_APPLICATION_CREDENTIALS: bool = False + self.NOVA_MICROVERSION = '2.1' self.load_env_config() print("loading config file") @@ -101,6 +102,7 @@ def __init__(self, config_file: str): project_name=self.PROJECT_NAME, user_domain_name=self.USER_DOMAIN_NAME, project_domain_id=self.PROJECT_DOMAIN_ID, + compute_api_version=self.NOVA_MICROVERSION ) self.openstack_connection.authorize() logger.info("Connected to Openstack") @@ -129,6 +131,8 @@ def load_config_yml(self, config_file: str) -> None: self.GATEWAY_SECURITY_GROUP_ID = cfg["openstack"][ "gateway_security_group_id" ] + if "compute_api_version" in cfg["openstack"]: + self.NOVA_MICROVERSION = cfg["openstack"]["compute_api_version"] def _get_default_security_groups(self): return self.DEFAULT_SECURITY_GROUPS.copy()