Skip to content

Commit

Permalink
Merge pull request #452 from deNBI/fix/os_requests
Browse files Browse the repository at this point in the history
fix(OpenStack): Ability to set certain Compute-API version to evade undesirable behavior
  • Loading branch information
vktrrdk authored Jan 11, 2024
2 parents e8fdc3e + 36cc231 commit 41c54bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions simple_vm_client/openstack_connector/openstack_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 41c54bb

Please sign in to comment.