Fixing wrong license
[nepi.git] / src / nepi / resources / linux / ccn / ccnapplication.py
index c13c092..0ab6f0f 100644 (file)
@@ -3,9 +3,8 @@
 #    Copyright (C) 2013 INRIA
 #
 #    This program is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
+#    it under the terms of the GNU General Public License version 2 as
+#    published by the Free Software Foundation;
 #
 #    This program is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #
 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
 
-from nepi.execution.resource import clsinit_copy, ResourceState, \
-    reschedule_delay, failtrap
+from nepi.execution.resource import clsinit_copy, ResourceState
 from nepi.resources.linux.application import LinuxApplication
 from nepi.resources.linux.ccn.ccnd import LinuxCCND
-from nepi.util.timefuncs import tnow, tdiffsec
 
 import os
 
 @clsinit_copy
 class LinuxCCNApplication(LinuxApplication):
-    _rtype = "LinuxCCNApplication"
+    _rtype = "linux::CCNApplication"
 
     def __init__(self, ec, guid):
         super(LinuxCCNApplication, self).__init__(ec, guid)
@@ -35,7 +32,7 @@ class LinuxCCNApplication(LinuxApplication):
 
     @property
     def ccnd(self):
-        ccnd = self.get_connected(LinuxCCND.rtype())
+        ccnd = self.get_connected(LinuxCCND.get_rtype())
         if ccnd: return ccnd[0]
         return None
 
@@ -44,11 +41,10 @@ class LinuxCCNApplication(LinuxApplication):
         if self.ccnd: return self.ccnd.node
         return None
 
-    @failtrap
-    def deploy(self):
+    def do_deploy(self):
         if not self.ccnd or self.ccnd.state < ResourceState.READY:
             self.debug("---- RESCHEDULING DEPLOY ---- node state %s " % self.node.state )
-            self.ec.schedule(reschedule_delay, self.deploy)
+            self.ec.schedule(self.reschedule_delay, self.deploy)
         else:
             command = self.get("command") or ""
 
@@ -57,10 +53,9 @@ class LinuxCCNApplication(LinuxApplication):
             if not self.get("env"):
                 self.set("env", self._environment)
 
-            self.discover()
-            self.provision()
+            self.do_discover()
+            self.do_provision()
 
-            self.debug("----- READY ---- ")
             self.set_ready()
 
     @property