- # OVS needs to wait until all associated RMs are released
- # to be released
- try:
- from nepi.resources.planetlab.openvswitch.tunnel import Tunnel
- rm = self.get_connected(Tunnel.rtype())
- if rm and rm[0].state < ResourceState.FINISHED:
- self.ec.schedule(reschedule_delay, self.release)
- return
-
- msg = "Deleting the port %s" % self.get('port_name')
- self.info(msg)
- cmd = "sliver-ovs del_port %s" % self.get('port_name')
- (out, err), proc = self.node.run(cmd, self.ovswitch.ovs_checks,
- sudo = True)
-
- if proc.poll():
- self.fail()
- self.error(msg, out, err)
- raise RuntimeError, msg
- except:
- import traceback
- err = traceback.format_exc()
- self.error(err)
-
- super(OVSPort, self).release()
+
+ from nepi.resources.planetlab.openvswitch.tunnel import OVSTunnel
+ rm = self.get_connected(OVSTunnel.get_rtype())
+
+ if rm and rm[0].state < ResourceState.RELEASED:
+ self.ec.schedule(reschedule_delay, self.release)
+ return
+
+ cmd = "sliver-ovs del_port %s" % self.get('port_name')
+ (out, err), proc = self.node.run(cmd, self.ovsswitch.ovs_checks,
+ sudo = True)
+
+ msg = "Deleting the port %s" % self.get('port_name')
+ self.info(msg)
+
+ if proc.poll():
+ self.error(msg, out, err)
+ raise RuntimeError, msg
+
+ super(OVSPort, self).do_release()
+