From: Alina Quereilhac Date: Sun, 1 May 2011 17:30:30 +0000 (+0200) Subject: replaced box_get_address for get_address and box_get_route for get_route in testbed_impl X-Git-Tag: nepi_v2~98 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e73c860da9c990caf21189ff1dfc934085b4bffe;p=nepi.git replaced box_get_address for get_address and box_get_route for get_route in testbed_impl --- diff --git a/src/nepi/core/testbed_impl.py b/src/nepi/core/testbed_impl.py index 25982db8..ed9224a6 100644 --- a/src/nepi/core/testbed_impl.py +++ b/src/nepi/core/testbed_impl.py @@ -341,7 +341,7 @@ class TestbedController(execute.TestbedController): 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. @@ -369,7 +369,7 @@ class TestbedController(execute.TestbedController): 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 diff --git a/src/nepi/testbeds/netns/execute.py b/src/nepi/testbeds/netns/execute.py index 605d410f..cba37f07 100644 --- a/src/nepi/testbeds/netns/execute.py +++ b/src/nepi/testbeds/netns/execute.py @@ -47,21 +47,6 @@ class TestbedController(testbed_impl.TestbedController): 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 diff --git a/src/nepi/testbeds/ns3/execute.py b/src/nepi/testbeds/ns3/execute.py index 936d3ba2..04247939 100644 --- a/src/nepi/testbeds/ns3/execute.py +++ b/src/nepi/testbeds/ns3/execute.py @@ -77,21 +77,6 @@ class TestbedController(testbed_impl.TestbedController): 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 diff --git a/src/nepi/testbeds/planetlab/execute.py b/src/nepi/testbeds/planetlab/execute.py index 0f76fbfa..38bea7b6 100644 --- a/src/nepi/testbeds/planetlab/execute.py +++ b/src/nepi/testbeds/planetlab/execute.py @@ -132,13 +132,6 @@ class TestbedController(testbed_impl.TestbedController): 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) @@ -153,11 +146,7 @@ class TestbedController(testbed_impl.TestbedController): 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