Commit ecf45be5 authored by Loic Baron's avatar Loic Baron
Browse files

OMF testbeds hardcoded location = city + country

No related merge requests found
Pipeline #2051 passed with stage
Showing with 9 additions and 1 deletion
+9 -1
......@@ -50,7 +50,6 @@ class Omf(SfaParser):
'name': node.attrib['component_name'],
'manager': node.attrib['component_manager_id'],
'testbed': source,
'parser':self.__class__.__name__.lower(),
'exclusive': node.attrib['exclusive'],
'hardware_types': [],
'interfaces': [],
......@@ -65,6 +64,8 @@ class Omf(SfaParser):
if 'location' in element.tag:
resource['location'] = element.attrib
else:
resource['location'] = self.get_location(node.attrib['component_id'])
if 'available' in element.tag:
resource['available'] = element.attrib['now']
......@@ -78,6 +79,13 @@ class Omf(SfaParser):
# TODO channel?
return result
def get_location(self, id):
if 'omf:nitos' in id:
return {'city':'Volos', 'country':'Greece'}
if 'omf:paris' in id:
return {'city':'Paris', 'country':'France'}
return None
# node
# 'component_id="urn:publicid:IDN+omf:paris.fit-nitos.fr+interface+node41:if1" '
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment