raise AttributeError, "Attribute %s can only be queried during experiment design" % name
return factory.box_attributes.get_attribute_value(name)
- def box_get_route(self, guid, index, attribute):
+ def get_route(self, guid, index, attribute):
"""
Helper implementation for get_route, returns information
given to defer_add_route.
return routes[index][attribute_index]
- def box_get_address(self, guid, index, attribute='Address'):
+ def get_address(self, guid, index, attribute='Address'):
"""
Helper implementation for get_address, returns information
given to defer_add_address
except KeyError, AttributeError:
return value
- def get_route(self, guid, index, attribute):
- # TODO: fetch real data from netns
- try:
- return self.box_get_route(guid, int(index), attribute)
- except KeyError, AttributeError:
- return None
-
- def get_address(self, guid, index, attribute='Address'):
- # TODO: fetch real data from netns
- try:
- return self.box_get_address(guid, int(index), attribute)
- except KeyError, AttributeError:
- return None
-
-
def action(self, time, guid, action):
raise NotImplementedError
return value == "true"
return value
- def get_route(self, guid, index, attribute):
- # TODO: fetch real data from ns3
- try:
- return self.box_get_route(guid, int(index), attribute)
- except KeyError, AttributeError:
- return None
-
- def get_address(self, guid, index, attribute='Address'):
- # TODO: fetch real data from ns3
- try:
- return self.box_get_address(guid, int(index), attribute)
- except KeyError, AttributeError:
- return None
-
-
def action(self, time, guid, action):
raise NotImplementedError
except KeyError, AttributeError:
return value
- def get_route(self, guid, index, attribute):
- # TODO: fetch real data from planetlab
- try:
- return self.box_get_route(guid, int(index), attribute)
- except KeyError, AttributeError:
- return None
-
def get_address(self, guid, index, attribute='Address'):
index = int(index)
return iface.broadcast
# if all else fails, query box
- try:
- return self.box_get_address(guid, index, attribute)
- except KeyError, AttributeError:
- return None
-
+ return self.get_address(guid, index, attribute)
def action(self, time, guid, action):
raise NotImplementedError