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):
"""
if not self._omf_api :
msg = "Credentials are not initialzed. XMPP Connections impossible"
self.error(msg)
- self.fail()
- return
+ 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
def start(self):
""" Start the RM. It means : Send Xmpp Message Using OMF protocol
to execute the application.
# Author: Alina Quereilhac <alina.quereilhac@inria.fr>
# Julien Tribino <julien.tribino@inria.fr>
--
- from nepi.execution.resource import ResourceManager, clsinit_copy, ResourceState, \
- reschedule_delay
+ from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay, failtrap
from nepi.execution.attribute import Attribute, Flags
from nepi.resources.omf.omf_resource import ResourceGateway, OMFResource
from nepi.resources.omf.omf_api import OMFAPIFactory
except AttributeError:
msg = "Credentials are not initialzed. XMPP Connections impossible"
self.error(msg)
- self.fail()
- #raise AttributeError, msg
- raise
++ raise
super(OMFNode, self).deploy()
# Lucia Guevgeozian <lucia.guevgeozian_odizzio@inria.fr>
from nepi.execution.attribute import Attribute, Flags, Types
- from nepi.execution.resource import ResourceManager, clsinit, ResourceState, \
- reschedule_delay
+ from nepi.execution.resource import ResourceManager, clsinit_copy, \
+ ResourceState, reschedule_delay
+
+
class ResourceGateway:
"""
Dictionary used to set OMF gateway depending on Testbed information.
"""
++ #XXX: A.Q. COMMENT: This looks a bit hardcoded
++ # SHOULDN'T THIS BE IN A SEPARATED FILE RATHER THAN IN THE
++ # BASE CLASS FOR ALL OMF RESOURCES?
TestbedtoGateway = dict({
"wilabt" : "ops.wilab2.ilabt.iminds.be",
"nitos" : "nitlab.inf.uth.gr",
"nicta" : "??.??.??",
+
})
- @clsinit
+ AMtoGateway = dict({
+ "am.wilab2.ilabt.iminds.be" : "ops.wilab2.ilabt.iminds.be",
+ "nitlab.inf.uth.gr" : "nitlab.inf.uth.gr",
+ "nicta" : "??.??.??",
+ })
+
+ @clsinit_copy
class OMFResource(ResourceManager):
"""
Generic resource gathering XMPP credential information and common methods
self.ec.set(self.iface1, 'type', "g")
self.ec.set(self.iface1, 'essid', "vlcexp")
self.ec.set(self.iface1, 'ip', "10.0.0.17")
- self.ec.set(self.iface1, 'xmppSlice', "nepi")
- self.ec.set(self.iface1, 'xmppHost', "xmpp-plexus.onelab.eu")
- self.ec.set(self.iface1, 'xmppPort', "5222")
- self.ec.set(self.iface1, 'xmppPassword', "1234")
-
+
self.channel = self.ec.register_resource("OMFChannel")
self.ec.set(self.channel, 'channel', "6")
self.ec.set(self.channel, 'xmppSlice', "nepi")