git://git.onelab.eu
/
nepi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding data progressing functions for CCN
[nepi.git]
/
src
/
nepi
/
resources
/
linux
/
application.py
diff --git
a/src/nepi/resources/linux/application.py
b/src/nepi/resources/linux/application.py
index
86cf9c9
..
ca9772d
100644
(file)
--- a/
src/nepi/resources/linux/application.py
+++ b/
src/nepi/resources/linux/application.py
@@
-173,7
+173,9
@@
class LinuxApplication(ResourceManager):
super(LinuxApplication, self).__init__(ec, guid)
self._pid = None
self._ppid = None
super(LinuxApplication, self).__init__(ec, guid)
self._pid = None
self._ppid = None
+ self._node = None
self._home = "app-%s" % self.guid
self._home = "app-%s" % self.guid
+
# whether the command should run in foreground attached
# to a terminal
self._in_foreground = False
# whether the command should run in foreground attached
# to a terminal
self._in_foreground = False
@@
-194,9
+196,16
@@
class LinuxApplication(ResourceManager):
@property
def node(self):
@property
def node(self):
- node = self.get_connected(LinuxNode.get_rtype())
- if node: return node[0]
- return None
+ if not self._node:
+ node = self.get_connected(LinuxNode.get_rtype())
+ if not node:
+ msg = "Application %s guid %d NOT connected to Node" % (
+ self._rtype, self.guid)
+ raise RuntimeError, msg
+
+ self._node = node[0]
+
+ return self._node
@property
def app_home(self):
@property
def app_home(self):
@@
-639,7
+648,7
@@
class LinuxApplication(ResourceManager):
if (proc and proc.poll()) or err:
msg = " Failed to STOP command '%s' " % self.get("command")
self.error(msg, out, err)
if (proc and proc.poll()) or err:
msg = " Failed to STOP command '%s' " % self.get("command")
self.error(msg, out, err)
-
+
super(LinuxApplication, self).do_stop()
def do_release(self):
super(LinuxApplication, self).do_stop()
def do_release(self):
@@
-711,6
+720,7
@@
class LinuxApplication(ResourceManager):
def execute_command(self, command,
env = None,
sudo = False,
def execute_command(self, command,
env = None,
sudo = False,
+ tty = False,
forward_x11 = False,
blocking = False):
forward_x11 = False,
blocking = False):
@@
-722,6
+732,7
@@
class LinuxApplication(ResourceManager):
return self.node.execute(command,
sudo = sudo,
return self.node.execute(command,
sudo = sudo,
+ tty = tty,
forward_x11 = forward_x11,
blocking = blocking)
forward_x11 = forward_x11,
blocking = blocking)