From 63ce337e1d88913f1aa6684496bdbd4c6de37a8a Mon Sep 17 00:00:00 2001 From: IWASE Yusuke Date: Wed, 9 Nov 2016 14:17:12 +0900 Subject: [PATCH] contrib: Revert module path to ryu.contrib Signed-off-by: IWASE Yusuke Signed-off-by: FUJITA Tomonori --- ryu/app/wsgi.py | 18 ++++++++---------- ryu/cmd/manager.py | 12 +----------- ryu/cmd/of_config_cli.py | 11 ++++------- ryu/cmd/rpc_cli.py | 6 +----- ryu/cmd/ryu_base.py | 8 +++----- ryu/lib/of_config/__init__.py | 5 +---- 6 files changed, 18 insertions(+), 42 deletions(-) diff --git a/ryu/app/wsgi.py b/ryu/app/wsgi.py index 6687dc2f..3c8bc936 100644 --- a/ryu/app/wsgi.py +++ b/ryu/app/wsgi.py @@ -17,22 +17,20 @@ import inspect from types import MethodType -import webob.dec -from webob.response import Response -from ryu import cfg -from ryu.lib import hub -from routes import Mapper -from routes.util import URLGenerator - -import ryu.contrib -ryu.contrib.update_module_path() from tinyrpc.server import RPCServer from tinyrpc.dispatch import RPCDispatcher from tinyrpc.dispatch import public as rpc_public from tinyrpc.protocols.jsonrpc import JSONRPCProtocol from tinyrpc.transports import ServerTransport, ClientTransport from tinyrpc.client import RPCClient -ryu.contrib.restore_module_path() +import webob.dec +from webob.response import Response + +from ryu import cfg +from ryu.lib import hub +from routes import Mapper +from routes.util import URLGenerator + CONF = cfg.CONF CONF.register_cli_opts([ diff --git a/ryu/cmd/manager.py b/ryu/cmd/manager.py index 1e1a6b41..dc7aca88 100755 --- a/ryu/cmd/manager.py +++ b/ryu/cmd/manager.py @@ -19,19 +19,9 @@ from ryu.lib import hub hub.patch(thread=False) -# TODO: -# Right now, we have our own patched copy of ovs python bindings -# Once our modification is upstreamed and widely deployed, -# use it -# -# NOTE: this modifies sys.path and thus affects the following imports. -import ryu.contrib -ryu.contrib.update_module_path() - from ryu import cfg -import logging -import sys +import logging from ryu import log log.early_init_log(logging.DEBUG) diff --git a/ryu/cmd/of_config_cli.py b/ryu/cmd/of_config_cli.py index 1601503c..8bfbad03 100755 --- a/ryu/cmd/of_config_cli.py +++ b/ryu/cmd/of_config_cli.py @@ -25,18 +25,15 @@ from __future__ import print_function -import ryu.contrib -ryu.contrib.update_module_path() - -from ryu import cfg - import cmd import sys -import lxml.etree as ET +import lxml.etree as ET +from ncclient.operations.rpc import RPCError + +from ryu import cfg from ryu.lib import of_config from ryu.lib.of_config import capable_switch -from ncclient.operations.rpc import RPCError import ryu.lib.of_config.classes as ofc diff --git a/ryu/cmd/rpc_cli.py b/ryu/cmd/rpc_cli.py index 57ad0e01..ac542143 100755 --- a/ryu/cmd/rpc_cli.py +++ b/ryu/cmd/rpc_cli.py @@ -31,17 +31,13 @@ from __future__ import print_function -import ryu.contrib -ryu.contrib.update_module_path() - -from ryu import cfg - import cmd import signal import socket import sys import termios +from ryu import cfg from ryu.lib import rpc diff --git a/ryu/cmd/ryu_base.py b/ryu/cmd/ryu_base.py index 05b6cd18..4c1cd6f6 100644 --- a/ryu/cmd/ryu_base.py +++ b/ryu/cmd/ryu_base.py @@ -14,15 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import ryu.contrib -ryu.contrib.update_module_path() +import argparse +import os.path +import sys from ryu import cfg from ryu import utils from ryu import version -import argparse -import os.path -import sys subcommands = { diff --git a/ryu/lib/of_config/__init__.py b/ryu/lib/of_config/__init__.py index cd419c11..4a12b299 100644 --- a/ryu/lib/of_config/__init__.py +++ b/ryu/lib/of_config/__init__.py @@ -22,9 +22,6 @@ import glob import os.path import sys -# we require ncclient -import ryu.contrib -ryu.contrib.update_module_path() SCHEMA_DIR = os.path.dirname(__file__) @@ -34,7 +31,7 @@ _files = glob.glob(os.path.join(SCHEMA_DIR, 'of-config-*.xsd')) OF_CONFIG_XSD_FILES = dict( (os.path.basename(f)[len(_PREFIX):-len(_SUFFIX)], f) for f in _files) -# For convinience +# For convenience # OF_CONFIG_1_0_XSD = os.path.join(SCHEMA_DIR, 'of-config-1.0.xsd') # and so on _this_module = sys.modules[__name__]