Skip to content

Commit 41c54bb

Browse files
authored
Merge pull request #452 from deNBI/fix/os_requests
fix(OpenStack): Ability to set certain Compute-API version to evade undesirable behavior
2 parents e8fdc3e + 36cc231 commit 41c54bb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

simple_vm_client/openstack_connector/openstack_connector.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def __init__(self, config_file: str):
7777
self.APPLICATION_CREDENTIAL_ID = ""
7878
self.APPLICATION_CREDENTIAL_SECRET = ""
7979
self.USE_APPLICATION_CREDENTIALS: bool = False
80+
self.NOVA_MICROVERSION = '2.1'
8081

8182
self.load_env_config()
8283
print("loading config file")
@@ -101,6 +102,7 @@ def __init__(self, config_file: str):
101102
project_name=self.PROJECT_NAME,
102103
user_domain_name=self.USER_DOMAIN_NAME,
103104
project_domain_id=self.PROJECT_DOMAIN_ID,
105+
compute_api_version=self.NOVA_MICROVERSION
104106
)
105107
self.openstack_connection.authorize()
106108
logger.info("Connected to Openstack")
@@ -129,6 +131,8 @@ def load_config_yml(self, config_file: str) -> None:
129131
self.GATEWAY_SECURITY_GROUP_ID = cfg["openstack"][
130132
"gateway_security_group_id"
131133
]
134+
if "compute_api_version" in cfg["openstack"]:
135+
self.NOVA_MICROVERSION = cfg["openstack"]["compute_api_version"]
132136

133137
def _get_default_security_groups(self):
134138
return self.DEFAULT_SECURITY_GROUPS.copy()

0 commit comments

Comments
 (0)