ResourceAction
from nepi.resources.linux.application import LinuxApplication
from nepi.resources.linux.ccn.ccnd import LinuxCCND
-from nepi.resources.linux.node import OSType
-
-from nepi.util.sshfuncs import ProcStatus
from nepi.util.timefuncs import strfnow, strfdiff
+
import os
reschedule_delay = "0.5s"
def __init__(self, ec, guid):
super(LinuxCCNR, self).__init__(ec, guid)
+ self._home = "ccnr-%s" % self.guid
+
# Marks whether ccnr is running
self._running = False
if ccnd: return ccnd[0]
return None
+ @property
+ def node(self):
+ if self.ccnd: return self.ccnd.node
+ return None
+
def deploy(self):
if not self.get("command"):
self.set("command", self._default_command)
# Invoke the actual deployment
super(LinuxCCNR, self).deploy()
- # As soon as the ccnd sources are deployed, we launch the
- # daemon ( we don't want to lose time launching the ccn
- # daemon later on )
+ # As soon as deployment is finished, we launch the ccnr
+ # command ( we don't want to lose time ccnr later on )
if self._state == ResourceState.READY:
self._start_in_background()
self._running = True
@property
def state(self):
- state = super(LinuxCCNR, self).state()
- if self._state in [ResourceState.TERMINATED, ResourceState.FAILED]:
+ state = super(LinuxCCNR, self).state
+ if self._state in [ResourceState.FINISHED, ResourceState.FAILED]:
self._running = False
if self._state == ResourceState.READY: