Skip to content
Snippets Groups Projects
Commit 99a3013c authored by Erik Reid's avatar Erik Reid
Browse files

use local rather than global var

parent 19b38587
No related branches found
No related tags found
No related merge requests found
...@@ -386,13 +386,12 @@ def load_routers_from_junosspace(config): ...@@ -386,13 +386,12 @@ def load_routers_from_junosspace(config):
def _derive_hostname(n): def _derive_hostname(n):
# TODO: ask ops if this name->hostname operation is valid # TODO: ask ops if this name->hostname operation is valid
if name.endswith('geant.net'): if n.endswith('geant.net'):
return name return n
m = re.match(r'^(.*?)(\.re\d+)?$', name) m = re.match(r'^(.*?)(\.re\d+)?$', n)
if m: if m:
return m.group(1) + '.geant.net' return m.group(1) + '.geant.net'
logger.error( logger.error(f'unrecognized junosspace device name format: "{n}"')
'unrecognized junosspace device name format :%s' % name)
return None return None
for d in devices.xpath('//devices/device'): for d in devices.xpath('//devices/device'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment