Skip to content

Commit

Permalink
using name when retrieving sense instance details
Browse files Browse the repository at this point in the history
  • Loading branch information
abessiari committed Nov 12, 2024
1 parent c50c3f1 commit d4d1179
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fabfed/provider/sense/sense_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def create(self):
raise Exception(f"Creation failed for {si_uuid} {status}")

logger.debug(f"Retrieving details {self.name} {status}")
instance_dict = sense_utils.service_instance_details(si_uuid=si_uuid)
instance_dict = sense_utils.service_instance_details(si_uuid=si_uuid, alias=self.name)

import json

Expand Down
2 changes: 1 addition & 1 deletion fabfed/provider/sense/sense_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def create(self):
raise SenseException(f"Instance is not ready:status={status}")

""" retrieve the gateway type from intents """
instance_dict = sense_utils.service_instance_details(si_uuid=si_uuid)
instance_dict = sense_utils.service_instance_details(si_uuid=si_uuid, alias=self.network)
gateway_type = instance_dict.get("intents")[0]['json']['data']['gateways'][0]['type'].upper()
if "GCP" in gateway_type:
template_file = 'gcp-template.json'
Expand Down
4 changes: 2 additions & 2 deletions fabfed/provider/sense/sense_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ def instance_get_status(*, client=None, si_uuid):
return workflow_api.instance_get_status(si_uuid=si_uuid)


def service_instance_details(*, client=None, si_uuid):
def service_instance_details(*, client=None, si_uuid, alias):
client = client or get_client()
discover_api = DiscoverApi(req_wrapper=client)
response = discover_api.discover_service_instances_get()
response = discover_api.discover_service_instances_get(search=alias)
# print(json.dumps(json.loads(response), indent=2))
response = json.loads(response)
instances = response['instances']
Expand Down

0 comments on commit d4d1179

Please sign in to comment.