"""
rm = self.ec.get_resource(guid)
- if rm.rtype() in self._authorized_connections:
+ if rm.get_rtype() in self._authorized_connections:
msg = "Connection between %s %s and %s %s accepted" % (
- self.rtype(), self._guid, rm.rtype(), guid)
+ self.get_rtype(), self._guid, rm.get_rtype(), guid)
self.debug(msg)
return True
msg = "Connection between %s %s and %s %s refused" % (
- self.rtype(), self._guid, rm.rtype(), guid)
+ self.get_rtype(), self._guid, rm.get_rtype(), guid)
self.debug(msg)
return False
rm_iface = self.ec.get_resource(elt)
for conn in rm_iface.connections:
rm_node = self.ec.get_resource(conn)
- if rm_node.rtype() == "OMFNode" and rm_node.get('hostname'):
+ if rm_node.get_rtype() == "OMFNode" and rm_node.get('hostname'):
if rm_iface.state < ResourceState.PROVISIONED or \
rm_node.state < ResourceState.READY:
return "reschedule"
It becomes DEPLOYED after sending messages to configure the channel
"""
+ if not (self.get('xmppSlice') and self.get('xmppHost')
+ and self.get('xmppPort') and self.get('xmppPassword')):
+ msg = "Credentials are not initialzed. XMPP Connections impossible"
+ self.error(msg)
+ raise RuntimeError, msg
+
if not self._omf_api :
self._omf_api = OMFAPIFactory.get_api(self.get('xmppSlice'),
self.get('xmppHost'), self.get('xmppPort'),
self.get('xmppPassword'), exp_id = self.exp_id)
- if not self._omf_api :
- msg = "Credentials are not initialzed. XMPP Connections impossible"
- self.error(msg)
- raise RuntimeError, msg
-
if not self.get('channel'):
msg = "Channel's value is not initialized"
self.error(msg)
if self._nodes_guid == "reschedule" :
self.ec.schedule("2s", self.deploy)
else:
- try:
- for couple in self._nodes_guid:
- #print "Couple node/alias : " + couple[0] + " , " + couple[1]
- attrval = self.get('channel')
- attrname = "net/%s/%s" % (couple[1], 'channel')
- self._omf_api.configure(couple[0], attrname, attrval)
- except AttributeError:
- msg = "Credentials are not initialzed. XMPP Connections impossible"
- self.error(msg)
- raise
+ for couple in self._nodes_guid:
+ attrval = self.get('channel')
+ attrname = "net/%s/%s" % (couple[1], 'channel')
+ self._omf_api.configure(couple[0], attrname, attrval)
super(OMFChannel, self).do_deploy()