Added unit tests for linux application
[nepi.git] / src / neco / resources / omf / omf_interface.py
index bbfc045..1bc0fc4 100644 (file)
@@ -26,6 +26,7 @@ class OMFWifiInterface(ResourceManager):
     """
     _rtype = "OMFWifiInterface"
     _authorized_connections = ["OMFNode" , "OMFChannel"]
+    _waiters = ["OMFNode"]
 
     #alias2name = dict({'w0':'wlan0', 'w1':'wlan1'})
 
@@ -34,7 +35,7 @@ class OMFWifiInterface(ResourceManager):
         """Register the attributes of an OMF interface 
 
         """
-        alias = Attribute("alias","Alias of the interface", default_value = "w0")
+        alias = Attribute("alias","Alias of the interface", default = "w0")
         mode = Attribute("mode","Mode of the interface")
         type = Attribute("type","Type of the interface")
         essid = Attribute("essid","Essid of the interface")
@@ -102,19 +103,13 @@ class OMFWifiInterface(ResourceManager):
                 return rm
         return None
 
-    def deploy(self):
+    def deploy_action(self):
         """Deploy the RM
 
         """
-        super(OMFWifiInterface, self).deploy()
         self._omf_api = OMFAPIFactory.get_api(self.get('xmppSlice'), 
             self.get('xmppHost'), self.get('xmppPort'), self.get('xmppPassword'))
 
-
-    def start(self):
-        """Send Xmpp Messages Using OMF protocol to configure Interface
-
-        """
         self._logger.debug(" " + self.rtype() + " ( Guid : " + str(self._guid) +") : " +
             self.get('mode') + " : " + self.get('type') + " : " +
             self.get('essid') + " : " + self.get('ip'))
@@ -126,6 +121,15 @@ class OMFWifiInterface(ResourceManager):
                 attrname = "net/%s/%s" % (self._alias, attrname)
                 #print "Send the configure message"
                 self._omf_api.configure(rm_node.get('hostname'), attrname, attrval)
+
+        super(OMFWifiInterface, self).deploy_action()
+
+
+    def start(self):
+        """Send Xmpp Messages Using OMF protocol to configure Interface
+
+        """
+
         super(OMFWifiInterface, self).start()
 
     def stop(self):