From fe5a0d0304e330923b2061ffc770d362c33c8498 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Tue, 7 Nov 2023 17:26:55 +0100 Subject: [PATCH] fixed sec groups --- .../openstack_connector/openstack_connector.py | 7 +++++-- simple_vm_client/util/state_enums.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/simple_vm_client/openstack_connector/openstack_connector.py b/simple_vm_client/openstack_connector/openstack_connector.py index b8f036b..5a88542 100644 --- a/simple_vm_client/openstack_connector/openstack_connector.py +++ b/simple_vm_client/openstack_connector/openstack_connector.py @@ -126,6 +126,9 @@ def load_config_yml(self, config_file: str) -> None: "gateway_security_group_id" ] + def _get_default_security_groups(self): + return self.DEFAULT_SECURITY_GROUPS.copy() + def load_env_config(self) -> None: logger.info("Load environment config: OpenStack") @@ -1195,7 +1198,7 @@ def start_server( network: Network = self.get_network() key_name = f"{servername}_{metadata['project_name']}" logger.info(f"Key name {key_name}") - security_groups = self.DEFAULT_SECURITY_GROUPS + security_groups = self._get_default_security_groups() if research_environment_metadata: security_groups.append( self.get_or_create_research_environment_security_group( @@ -1279,7 +1282,7 @@ def start_server_with_playbook( ) -> tuple[str, str]: logger.info(f"Start Server {servername}") - security_groups = self.DEFAULT_SECURITY_GROUPS + security_groups = self._get_default_security_groups() if research_environment_metadata: security_groups.append( self.get_or_create_research_environment_security_group( diff --git a/simple_vm_client/util/state_enums.py b/simple_vm_client/util/state_enums.py index c4bca86..9554c82 100644 --- a/simple_vm_client/util/state_enums.py +++ b/simple_vm_client/util/state_enums.py @@ -69,6 +69,7 @@ class VmStates(Enum): ERROR = "error" SHELVED = "shelved" SHELVED_OFFLOADED = "shelved_offloaded" + DISABLED = "disabled" # Custom vm states NOT_FOUND = "not_found"