Skip to content

Commit

Permalink
fix(Ansible):added additional check if vm is reachable bfore running …
Browse files Browse the repository at this point in the history
…playbook
  • Loading branch information
dweinholz committed Jan 30, 2024
1 parent c48efb8 commit c780dc9
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions simple_vm_client/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Which can be used for the PortalClient.
"""
from __future__ import annotations

from __future__ import annotations

from simple_vm_client.bibigrid_connector.bibigrid_connector import BibigridConnector
from simple_vm_client.forc_connector.forc_connector import ForcConnector
Expand Down Expand Up @@ -406,19 +406,21 @@ def create_and_deploy_playbook(
self.openstack_connector.get_vm_ports(openstack_id=openstack_id)["port"]
)
gateway_ip = self.openstack_connector.get_gateway_ip()["gateway_ip"]
cloud_site = self.openstack_connector.CLOUD_SITE
return self.forc_connector.create_and_deploy_playbook(
public_key=public_key,
research_environment_template=research_environment_template,
create_only_backend=create_only_backend,
conda_packages=conda_packages,
apt_packages=apt_packages,
openstack_id=openstack_id,
port=port,
ip=gateway_ip,
cloud_site=cloud_site,
base_url=base_url,
)
if self.openstack_connector.netcat(host=gateway_ip, port=port):

cloud_site = self.openstack_connector.CLOUD_SITE
return self.forc_connector.create_and_deploy_playbook(
public_key=public_key,
research_environment_template=research_environment_template,
create_only_backend=create_only_backend,
conda_packages=conda_packages,
apt_packages=apt_packages,
openstack_id=openstack_id,
port=port,
ip=gateway_ip,
cloud_site=cloud_site,
base_url=base_url,
)

def is_bibigrid_available(self) -> bool:
return self.bibigrid_connector.is_bibigrid_available()
Expand Down

0 comments on commit c780dc9

Please sign in to comment.