Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
ryu/exception.py | 4 ++++
ryu/utils.py | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ryu/exception.py b/ryu/exception.py
index 0a1e72c..2c46092 100644
--- a/ryu/exception.py
+++ b/ryu/exception.py
@@ -62,3 +62,7 @@ class PortUnknown(RyuException):
class MacAddressDuplicated(RyuException):
message = 'MAC address %(mac)s is duplicated'
+
+
+class DoubleImport(RyuException):
+ message = 'double import of $(module) detected'
diff --git a/ryu/utils.py b/ryu/utils.py
index 689b8a4..f116a66 100644
--- a/ryu/utils.py
+++ b/ryu/utils.py
@@ -36,6 +36,7 @@ import os
import sys
import re
from oslo.config import cfg
+from ryu.exception import DoubleImport
LOG = logging.getLogger('ryu.utils')
@@ -89,7 +90,7 @@ def import_module(modname):
sys.path.append(dirname)
try:
__import__(name)
- except cfg.ArgsAlreadyParsedError:
+ except (cfg.ArgsAlreadyParsedError, DoubleImport):
# ryu-manager needs to import modules calling
# register_cli_opts. Thus, passing a imported file as a
# command line option for ryu-manager results in double import
--
1.8.3.1
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel