Skip to content

Commit

Permalink
add verify ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
kthare10 committed May 14, 2024
1 parent a92e11c commit f05bfda
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions fabric_am/handlers/switch_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def create(self, unit: ConfigToken) -> Tuple[dict, ConfigToken]:
data_loader = DataLoader()
inventory = InventoryManager(loader=data_loader,
sources=[inventory_path])
host = inventory.get_host(hostname=f"{sliver.get_site()}-p4.fabric-testbed.net")
host = inventory.get_host(hostname=f"{sliver.get_site().lower()}-p4.fabric-testbed.net")
ansible_host = host.get_vars().get('ansible_host')
ansible_ssh_user = host.get_vars().get('ansible_ssh_user')
ansible_ssh_pwd = host.get_vars().get('ansible_ssh_pwd')
Expand All @@ -148,11 +148,6 @@ def create(self, unit: ConfigToken) -> Tuple[dict, ConfigToken]:
except Exception as e:
self.get_logger().error(e)
self.get_logger().error(traceback.format_exc())
# Delete VM in case of failure
if sliver is not None and unit_id is not None:
time.sleep(5)
self.__cleanup(sliver=sliver, unit_id=unit_id)

result = {Constants.PROPERTY_TARGET_NAME: Constants.TARGET_CREATE,
Constants.PROPERTY_TARGET_RESULT_CODE: Constants.RESULT_CODE_EXCEPTION,
Constants.PROPERTY_ACTION_SEQUENCE_NUMBER: 0,
Expand Down

0 comments on commit f05bfda

Please sign in to comment.