"""
_rtype = "LinuxApplication"
+ _help = "Runs an application on a Linux host with a BASH command "
+ _backend_type = "linux"
+
@classmethod
def _register_attributes(cls):
# Since provisioning takes a long time, before
# each step we check that the EC is still
for step in steps:
- if self.ec.finished:
+ if self.ec.abort:
raise RuntimeError, "EC finished"
ret = step()
self.provision()
except:
self.fail()
- raise
+ return
super(LinuxApplication, self).deploy()
self.set_finished()
else:
- if self.in_foreground:
- self._run_in_foreground()
- else:
- self._run_in_background()
+ try:
+ if self.in_foreground:
+ self._run_in_foreground()
+ else:
+ self._run_in_background()
+ except:
+ self.fail()
+ return
super(LinuxApplication, self).start()
blocking = False)
if self._proc.poll():
- self.fail()
self.error(msg, out, err)
raise RuntimeError, msg
msg = " Failed to start command '%s' " % command
if proc.poll():
- self.fail()
self.error(msg, out, err)
raise RuntimeError, msg
# Out is what was written in the stderr file
if err:
- self.fail()
msg = " Failed to start command '%s' " % command
self.error(msg, out, err)
raise RuntimeError, msg
msg = " Failed to STOP command '%s' " % self.get("command")
self.error(msg, out, err)
self.fail()
+ return
- if self.state == ResourceState.STARTED:
super(LinuxApplication, self).stop()
def release(self):
self.stop()
- if self.state != ResourceState.FAILED:
- self.info("Resource released")
-
- super(LinuxApplication, self).release()
+ super(LinuxApplication, self).release()
@property
def state(self):