Catch exception on socket open and exit
diff --git a/src/python/oftest/dataplane.py b/src/python/oftest/dataplane.py
index 70b4e9e..965bd62 100644
--- a/src/python/oftest/dataplane.py
+++ b/src/python/oftest/dataplane.py
@@ -62,9 +62,13 @@
self.packets = []
self.packets_discarded = 0
self.port_number = port_number
- self.socket = self.interface_open(interface_name)
logname = "dp-" + interface_name
self.logger = logging.getLogger(logname)
+ try:
+ self.socket = self.interface_open(interface_name)
+ except:
+ self.logger.info("Could not open socket")
+ sys.exit(1)
self.logger.info("Openned port monitor socket")
self.parent = parent
self.pkt_sync = self.parent.pkt_sync