X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Fccn%2Fccnapplication.py;h=0ab6f0fe72bc7759bbbc91ff4729a585bdc059f9;hb=e55924b6886bd7382a28e1ae235c4810f852e163;hp=c13c0920cc9523c65f23f719fe94c45fb4190482;hpb=99d8b2a4431d8fafd0385e189375106d46f1abd9;p=nepi.git diff --git a/src/nepi/resources/linux/ccn/ccnapplication.py b/src/nepi/resources/linux/ccn/ccnapplication.py index c13c0920..0ab6f0fe 100644 --- a/src/nepi/resources/linux/ccn/ccnapplication.py +++ b/src/nepi/resources/linux/ccn/ccnapplication.py @@ -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 @@ -17,17 +16,15 @@ # # Author: Alina Quereilhac -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