import time
+reschedule_check = "0.3s"
+confirmation_counter = 300
+
@clsinit_copy
class OMFNode(OMFResource):
"""
def do_deploy(self):
""" Deploy the RM. It means : Send Xmpp Message Using OMF protocol
to enroll the node into the experiment.
- It becomes DEPLOYED after sending messages to enroll the node
"""
if not self.get('xmppServer'):
super(OMFNode, self).do_deploy()
def do_release(self):
- """ Clean the RM at the end of the experiment
+ """ Clean the RM at the end of the experiment by unenrolling
+ the node from the topic
"""
from nepi.resources.omf.application import OMFApplication
self.ec.schedule(reschedule_delay, self.release)
return
+ from nepi.resources.omf.interface import OMFWifiInterface
+ rm_list = self.get_connected(OMFWifiInterface.get_rtype())
+ if rm_list:
+ for rm in rm_list:
+ if rm.state < ResourceState.RELEASED:
+ self.ec.schedule(reschedule_delay, self.release)
+ return
+
if self._omf_api:
if self.get('version') == "5":
self._omf_api.release(self.get('hostname'))