from nepi.resources.omf.node import OMFNode
from nepi.resources.omf.omf_api import OMFAPIFactory
-#from nepi.util.sshfuncs import ProcStatus
-from nepi.util import sshfuncs
-
-
@clsinit_copy
class OMFApplication(OMFResource):
"""
args = Attribute("args", "Argument of the application")
env = Attribute("env", "Environnement variable of the application")
stdin = Attribute("stdin", "Input of the application", default = "")
- sources = Attribute("sources", "Sources of the application",
- flags = Flags.ExecReadOnly)
- sshuser = Attribute("sshUser", "user to connect with ssh",
- flags = Flags.ExecReadOnly)
- sshkey = Attribute("sshKey", "key to use for ssh",
- flags = Flags.ExecReadOnly)
cls._register_attribute(appid)
cls._register_attribute(path)
cls._register_attribute(args)
cls._register_attribute(env)
cls._register_attribute(stdin)
- cls._register_attribute(sources)
- cls._register_attribute(sshuser)
- cls._register_attribute(sshkey)
def __init__(self, ec, guid):
"""
"This Application is already connected" ) % \
(self.rtype(), self._guid, rm.rtype(), guid)
self.debug(msg)
+
return False
+
else :
msg = "Connection between %s %s and %s %s accepted" % (
self.rtype(), self._guid, rm.rtype(), guid)
It becomes DEPLOYED after getting the xmpp client.
"""
- self.set('xmppSlice', self.node.get('xmppSlice'))
- self.set('xmppHost', self.node.get('xmppHost'))
- self.set('xmppPort', self.node.get('xmppPort'))
- self.set('xmppPassword', self.node.get('xmppPassword'))
-
if not self._omf_api :
self._omf_api = OMFAPIFactory.get_api(self.get('xmppSlice'),
self.get('xmppHost'), self.get('xmppPort'),
self.error(msg)
raise RuntimeError, msg
- if self.get('sources'):
- gateway = ResourceGateway.AMtoGateway[self.get('xmppHost')]
- user = self.get('sshUser') or self.get('xmppSlice')
- dst = user + "@"+ gateway + ":"
- (out, err), proc = sshfuncs.rcopy(self.get('sources'), dst)
-
super(OMFApplication, self).deploy()
@failtrap