minimize use of "from module import *"
This statement was causing strange bugs because of namespace pollution. The
order of imports mattered because later "from module import *" statements would
overwrite modules imported earlier. Transitive imports also made it difficult
to figure out where an identifier was being imported.
This statement is still allowed in test code since nothing else should be
importing it.
diff --git a/src/python/oftest/dataplane.py b/src/python/oftest/dataplane.py
index 78089e3..f70de6c 100644
--- a/src/python/oftest/dataplane.py
+++ b/src/python/oftest/dataplane.py
@@ -18,13 +18,13 @@
import os
import socket
import time
-import netutils
+import select
+import logging
from threading import Thread
from threading import Lock
from threading import Condition
-import select
-import logging
-from ofutils import *
+import ofutils
+import netutils
have_pypcap = False
try:
@@ -161,7 +161,7 @@
self.cvar = Condition()
# Used to wake up the event loop from another thread
- self.waker = EventDescriptor()
+ self.waker = ofutils.EventDescriptor()
self.killed = False
self.logger = logging.getLogger("dataplane")
@@ -320,7 +320,7 @@
return None
with self.cvar:
- ret = timed_wait(self.cvar, grab, timeout=timeout)
+ ret = ofutils.timed_wait(self.cvar, grab, timeout=timeout)
if ret != None:
return ret