summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2016-11-09 14:17:12 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-11-14 18:14:20 +0900
commit63ce337e1d88913f1aa6684496bdbd4c6de37a8a (patch)
treedff60d474d4ca95dee20b04842d44e5d9de8d2e7
parent2dc7d403bb024589de4c551e89980c7a2750acc7 (diff)
contrib: Revert module path to ryu.contrib
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/app/wsgi.py16
-rwxr-xr-xryu/cmd/manager.py12
-rwxr-xr-xryu/cmd/of_config_cli.py9
-rwxr-xr-xryu/cmd/rpc_cli.py6
-rw-r--r--ryu/cmd/ryu_base.py8
-rw-r--r--ryu/lib/of_config/__init__.py5
6 files changed, 16 insertions, 40 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
+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
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()
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
+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__]