Skip to content

Commit

Permalink
Merge pull request #94 from fabric-testbed/rel1.7
Browse files Browse the repository at this point in the history
Minor bug fix
  • Loading branch information
kthare10 authored Jul 15, 2024
2 parents af39745 + 1e5349e commit a880969
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fimutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This is a package of Information Model utilitied for FABRIC
for scanning different types of sites
"""
__VERSION__ = "1.7.0"
__VERSION__ = "1.7.1"
__version__ = __VERSION__
13 changes: 8 additions & 5 deletions fimutil/ralph/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def catalog(self):
results = self.ralph.get_json_object(self.ralph.base_uri + 'data-center-assets/?' +
urlencode(query))
p4_switch_url = pyjq.one('[ .results[0].url ]', results)[0]
if not p4_switch_url:
raise ValueError
logging.info(f'Identified P4 switch {p4_switch_url=}')
self.p4_switch = P4Switch(uri=p4_switch_url, ralph=self.ralph)
self.p4_switch.parse()
Expand Down Expand Up @@ -100,7 +102,8 @@ def catalog(self):
except ValueError:
logging.warning('Unable to find PTP server in site, continuing')

query = {'hostname__regex': f'{self.name.lower()}-w[0123456789]' + self.domain}
#query = {'hostname__regex': f'{self.name.lower()}-w[0123456789]' + self.domain}
query = {'hostname__startswith': f'{self.name.lower()}-w','limit': 100}
results = self.ralph.get_json_object(self.ralph.base_uri + 'data-center-assets/?' +
urlencode(query))

Expand All @@ -110,11 +113,11 @@ def catalog(self):
# not sure why the regex doesn't work as expected, ({self.name.lower()}-w[0123456789]+)
# so instead another simple regex to look for workers with two digit indexes

query = {'hostname__regex': f'{self.name.lower()}-w[0123456789][0123456789]' + self.domain}
results = self.ralph.get_json_object(self.ralph.base_uri + 'data-center-assets/?' +
urlencode(query))
#query = {'hostname__regex': f'{self.name.lower()}-w[0123456789][0123456789]' + self.domain}
#results = self.ralph.get_json_object(self.ralph.base_uri + 'data-center-assets/?' +
# urlencode(query))

worker_urls.extend(pyjq.one('[ .results[].url ]', results))
#worker_urls.extend(pyjq.one('[ .results[].url ]', results))

logging.info(f'Identified {len(worker_urls)} workers')

Expand Down

0 comments on commit a880969

Please sign in to comment.