revisited declaration of attributes for node and application
[nepi.git] / nepi / resources / linux / node.py
index 56cc715..32b590e 100644 (file)
@@ -149,81 +149,74 @@ class LinuxNode(ResourceManager):
 
     @classmethod
     def _register_attributes(cls):
-        cls._register_attribute(Attribute(
-            "hostname", "Hostname of the machine",
-            flags = Flags.Design))
-
-        cls._register_attribute(Attribute(
-            "username", "Local account username", 
-            flags = Flags.Credential))
-
-        cls._register_attribute(Attribute(
-            "port", "SSH port",
-            flags = Flags.Design))
-        
-        cls._register_attribute(Attribute(
-            "home",
-            "Experiment home directory to store all experiment related files",
-            flags = Flags.Design))
-        
-        cls._register_attribute(Attribute(
-            "identity", "SSH identity file",
-            flags = Flags.Credential))
-        
-        cls._register_attribute(Attribute(
-            "serverKey", "Server public key", 
-            flags = Flags.Design))
-        
-        cls._register_attribute(Attribute(
-            "cleanHome",
-            "Remove all nepi files and directories "
-            " from node home folder before starting experiment", 
-            type = Types.Bool,
-            default = False,
-            flags = Flags.Design))
-
-        cls._register_attribute(Attribute(
-            "cleanExperiment", "Remove all files and directories " 
-            " from a previous same experiment, before the new experiment starts", 
-            type = Types.Bool,
-            default = False,
-            flags = Flags.Design))
-        
-        cls._register_attribute(Attribute(
-            "cleanProcesses", 
-            "Kill all running processes before starting experiment",
-            type = Types.Bool,
-            default = False,
-            flags = Flags.Design))
-        
-        cls._register_attribute(Attribute(
-            "cleanProcessesAfter", 
-            """Kill all running processes after starting experiment
-            This might be dangerous when using user root""",
-            type = Types.Bool,
-            default = True,
-            flags = Flags.Design))
-        
-        cls._register_attribute(Attribute(
-            "tearDown",
-            "Bash script to be executed before releasing the resource",
-            flags = Flags.Design))
-
-        cls._register_attribute(Attribute(
-            "gatewayUser",
-            "Gateway account username",
-            flags = Flags.Design))
-
-        cls._register_attribute(Attribute(
-            "gateway",
-            "Hostname of the gateway machine",
-            flags = Flags.Design))
-
-        cls._register_attribute(Attribute(
-            "ip",
-            "Linux host public IP address. "
-            "Must not be modified by the user unless hostname is 'localhost'",
+        cls._register_attribute(
+            Attribute("hostname",
+                      "Hostname of the machine",
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("username",
+                      "Local account username", 
+                      flags = Flags.Credential))
+        cls._register_attribute(
+            Attribute("port",
+                      "SSH port",
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("home",
+                      "Experiment home directory to store all experiment related files",
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("identity",
+                      "SSH identity file",
+                      flags = Flags.Credential))
+        cls._register_attribute(
+            Attribute("serverKey",
+                      "Server public key", 
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("cleanHome",
+                      "Remove all nepi files and directories "
+                      " from node home folder before starting experiment", 
+                      type = Types.Bool,
+                      default = False,
             flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("cleanExperiment",
+                      "Remove all files and directories " 
+                      " from a previous same experiment, before the new experiment starts", 
+                      type = Types.Bool,
+                      default = False,
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("cleanProcesses",
+                      "Kill all running processes before starting experiment",
+                      type = Types.Bool,
+                      default = False,
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("cleanProcessesAfter",
+                      "Kill all running processes after starting experiment"
+                      "NOTE: This might be dangerous when using user root",
+                      type = Types.Bool,
+                      default = True,
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("tearDown",
+                      "Bash script to be executed before releasing the resource",
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("gatewayUser",
+                      "Gateway account username",
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("gateway",
+                      "Hostname of the gateway machine",
+                      flags = Flags.Design))
+        cls._register_attribute(
+            Attribute("ip",
+                      "Linux host public IP address. "
+                      "Must not be modified by the user unless hostname is 'localhost'",
+                      flags = Flags.Design))
 
     def __init__(self, ec, guid):
         super(LinuxNode, self).__init__(ec, guid)