Skip to content

Commit

Permalink
Merge pull request #625 from deNBI/fix/playbook_create_only_for_resenv
Browse files Browse the repository at this point in the history
fix(Playbook):if resenv provided but create only backend, resenv play…
  • Loading branch information
vktrrdk authored Nov 5, 2024
2 parents cd8c1a7 + 9ec87a9 commit 75ec7a2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion simple_vm_client/forc_connector/playbook/playbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def copy_playbooks_and_init(self, public_key: str) -> None:
self.yaml_exec.dump(data_gp, generic_playbook)

def copy_and_init_research_environment(self) -> None:
if not self.research_environment_template:
if not self.research_environment_template or self.create_only_backend:
return

shutil.copytree(
Expand Down
3 changes: 1 addition & 2 deletions simple_vm_client/openstack_connector/openstack_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def get_flavor(self, name_or_id: str, ignore_error: bool = False) -> Flavor:
message=f"Flavor {name_or_id} not found!", name_or_id=name_or_id
)
else:
return Flavor()
return None

return flavor

Expand Down Expand Up @@ -1263,7 +1263,6 @@ def get_server(self, openstack_id: str) -> Server:
ignore_not_active=True,
ignore_not_found=True,
)

server.flavor = self.get_flavor(
name_or_id=server.flavor["id"], ignore_error=True
)
Expand Down
6 changes: 5 additions & 1 deletion simple_vm_client/util/thrift_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ def os_to_thrift_server(openstack_server: OpenStack_Server) -> VM:
return VM(vm_state=VmStates.NOT_FOUND)
fixed_ip = ""
floating_ip = ""
flavor = os_to_thrift_flavor(openstack_flavor=openstack_server.flavor)
if openstack_server.flavor:

flavor = os_to_thrift_flavor(openstack_flavor=openstack_server.flavor)
else:
flavor = None
if openstack_server.image:
image = os_to_thrift_image(openstack_image=openstack_server.image)
else:
Expand Down

0 comments on commit 75ec7a2

Please sign in to comment.