Fixing LinuxNode error when checking for localhost
authorAlina Quereilhac <alina.quereilhac@inria.fr>
Sat, 2 Aug 2014 19:57:28 +0000 (21:57 +0200)
committerAlina Quereilhac <alina.quereilhac@inria.fr>
Sat, 2 Aug 2014 19:57:28 +0000 (21:57 +0200)
src/nepi/resources/linux/node.py
src/nepi/resources/linux/ns3/ns3simulation.py

index 01a1d40..fce5e6d 100644 (file)
@@ -278,8 +278,7 @@ class LinuxNode(ResourceManager):
         if self._os:
             return self._os
 
-        if self.get("hostname") not in ["localhost", "127.0.0.1"] and \
-                not self.get("username"):
+        if not self.localhost and not self.get("username"):
             msg = "Can't resolve OS, insufficient data "
             self.error(msg)
             raise RuntimeError, msg
@@ -333,7 +332,7 @@ class LinuxNode(ResourceManager):
 
     @property
     def localhost(self):
-        return self.get("hostname") in ['localhost', '127.0.0.7', '::1']
+        return self.get("hostname") in ['localhost', '127.0.0.1', '::1']
 
     def do_provision(self):
         # check if host is alive
@@ -404,8 +403,8 @@ class LinuxNode(ResourceManager):
 
     def clean_processes(self):
         self.info("Cleaning up processes")
-        if self.get("hostname") in ["localhost", "127.0.0.2"]:
+
+        if self.localhost:
             return 
         
         if self.get("username") != 'root':
index f9b9322..dae024f 100644 (file)
@@ -92,14 +92,12 @@ class LinuxNS3Simulation(LinuxApplication, NS3Simulation):
 
         ns3_version = Attribute("ns3Version",
             "Version of ns-3 to install from nsam repo",
-            #default = "ns-3.19", 
             default = "ns-3.20", 
             #default = "ns-3-dev", 
             flags = Flags.Design)
 
         pybindgen_version = Attribute("pybindgenVersion",
             "Version of pybindgen to install from bazar repo",
-            #default = "864", 
             default = "868", 
             #default = "876", 
             flags = Flags.Design)