Woops... fix broken commit about netrefs
authorClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Thu, 12 May 2011 13:05:42 +0000 (15:05 +0200)
committerClaudio-Daniel Freire <claudio-daniel.freire@inria.fr>
Thu, 12 May 2011 13:05:42 +0000 (15:05 +0200)
src/nepi/core/execute.py
test/testbeds/planetlab/integration_ns3.py

index 4567108..1167c21 100644 (file)
@@ -519,9 +519,8 @@ class ExperimentController(object):
 
     def is_finished(self, guid):
         for testbed in self._testbeds.values():
-            for guid_ in testbed.guids:
-                if guid_ == guid:
-                    return testbed.status(guid) == STATUS_FINISHED
+            if guid in testbed.guids:
+                return testbed.status(guid) == STATUS_FINISHED
         raise RuntimeError("No element exists with guid %d" % guid)    
 
     def set(self, testbed_guid, guid, name, value, time = TIME_NOW):
@@ -737,10 +736,13 @@ class ExperimentController(object):
                 for (name, value) in data.get_attribute_data(guid):
                     # Try to resolve create-time netrefs, if possible
                     if isinstance(value, basestring) and ATTRIBUTE_PATTERN_BASE.search(value):
-                        value = self.resolve_netref_value(value, value)
-                        data.set_attribute_data(guid, name, value)
-                        if (testbed_guid, guid) in self._netrefs:
-                            self._netrefs[(testbed_guid, guid)].discard(name)
+                        nuvalue = self.resolve_netref_value(value)
+                        if nuvalue is not None:
+                            # Only if we succeed we remove the netref deferral entry
+                            value = nuvalue
+                            data.set_attribute_data(guid, name, value)
+                            if (testbed_guid, guid) in self._netrefs:
+                                self._netrefs[(testbed_guid, guid)].discard(name)
                     testbed.defer_create_set(guid, name, value)
 
         for guid in element_guids: 
index 77bde6f..71f899d 100755 (executable)
@@ -105,7 +105,7 @@ class PlanetLabCrossIntegrationTestCase(unittest.TestCase):
         "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
     @test_util.skipUnless(os.environ.get('NEPI_FULL_TESTS','').lower() in ('1','yes','true','on'),
         "Test is expensive, requires NEPI_FULL_TESTS=yes")
-    def zuti_test_ns3_in_pl(self):
+    def test_ns3_in_pl(self):
         ns3_testbed_id = "ns3"
         ns3_testbed_version = "3_9_RC3"
         
@@ -135,7 +135,7 @@ class PlanetLabCrossIntegrationTestCase(unittest.TestCase):
         "Test requires PlanetLab authentication info (PL_USER and PL_PASS environment variables)")
     @test_util.skipUnless(os.environ.get('NEPI_FULL_TESTS','').lower() in ('1','yes','true','on'),
         "Test is expensive, requires NEPI_FULL_TESTS=yes")
-    def zuti_test_ns3_in_pl_crossconnect(self):
+    def test_ns3_in_pl_crossconnect(self):
         pl, exp = self.make_experiment_desc()
         
         # Create PL node, ifaces, assign addresses