From 494487437b91b9416276da744178654aaca052f1 Mon Sep 17 00:00:00 2001 From: gong yong sheng Date: Wed, 6 Jul 2016 16:08:12 +0800 Subject: [PATCH] Remove all openstack common stuff This is the last patch for tacker to use oslo codes. Change-Id: I163862f0d1a007afdfa91ed939648c73ae36ae5d Partial-bug: #1552282 --- openstack-common.conf | 35 ---------- tacker/common/rpc.py | 4 -- tacker/openstack/__init__.py | 0 tacker/openstack/common/__init__.py | 17 ----- tacker/openstack/common/network_utils.py | 89 ------------------------ tools/install_venv_common.py | 1 - 6 files changed, 146 deletions(-) delete mode 100644 openstack-common.conf delete mode 100644 tacker/openstack/__init__.py delete mode 100644 tacker/openstack/common/__init__.py delete mode 100644 tacker/openstack/common/network_utils.py diff --git a/openstack-common.conf b/openstack-common.conf deleted file mode 100644 index 4434dd57b..000000000 --- a/openstack-common.conf +++ /dev/null @@ -1,35 +0,0 @@ -[DEFAULT] -# The list of modules to copy from oslo-incubator.git -module=cache -module=context -module=db -module=db.sqlalchemy -module=eventlet_backdoor -module=excutils -module=fileutils -module=fixture -module=gettextutils -module=importutils -module=install_venv_common -module=jsonutils -module=local -module=lockutils -module=log -module=log_handler -module=loopingcall -module=middleware -module=network_utils -module=periodic_task -module=policy -module=processutils -module=service -module=sslutils -module=strutils -module=systemd -module=threadgroup -module=timeutils -module=uuidutils -module=versionutils - -# The base module to hold the copy of openstack.common -base=tacker diff --git a/tacker/common/rpc.py b/tacker/common/rpc.py index a6c462d99..67abb95fa 100644 --- a/tacker/common/rpc.py +++ b/tacker/common/rpc.py @@ -31,10 +31,6 @@ EXTRA_EXMODS = [] TRANSPORT_ALIASES = { - 'tacker.openstack.common.rpc.impl_fake': 'fake', - 'tacker.openstack.common.rpc.impl_qpid': 'qpid', - 'tacker.openstack.common.rpc.impl_kombu': 'rabbit', - 'tacker.openstack.common.rpc.impl_zmq': 'zmq', 'tacker.rpc.impl_fake': 'fake', 'tacker.rpc.impl_qpid': 'qpid', 'tacker.rpc.impl_kombu': 'rabbit', diff --git a/tacker/openstack/__init__.py b/tacker/openstack/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tacker/openstack/common/__init__.py b/tacker/openstack/common/__init__.py deleted file mode 100644 index d1223eaf7..000000000 --- a/tacker/openstack/common/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import six - - -six.add_move(six.MovedModule('mox', 'mox', 'mox3.mox')) diff --git a/tacker/openstack/common/network_utils.py b/tacker/openstack/common/network_utils.py deleted file mode 100644 index d9640d15a..000000000 --- a/tacker/openstack/common/network_utils.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright 2012 OpenStack Foundation. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -""" -Network-related utilities and helper functions. -""" - -# TODO(jd) Use six.moves once -# https://bitbucket.org/gutworth/six/pull-request/28 -# is merged -try: - import urllib.parse - SplitResult = urllib.parse.SplitResult -except ImportError: - import urlparse - SplitResult = urlparse.SplitResult - -from six.moves.urllib import parse - - -def parse_host_port(address, default_port=None): - """Interpret a string as a host:port pair. - - An IPv6 address MUST be escaped if accompanied by a port, - because otherwise ambiguity ensues: 2001:db8:85a3::8a2e:370:7334 - means both [2001:db8:85a3::8a2e:370:7334] and - [2001:db8:85a3::8a2e:370]:7334. - - >>> parse_host_port('server01:80') - ('server01', 80) - >>> parse_host_port('server01') - ('server01', None) - >>> parse_host_port('server01', default_port=1234) - ('server01', 1234) - >>> parse_host_port('[::1]:80') - ('::1', 80) - >>> parse_host_port('[::1]') - ('::1', None) - >>> parse_host_port('[::1]', default_port=1234) - ('::1', 1234) - >>> parse_host_port('2001:db8:85a3::8a2e:370:7334', default_port=1234) - ('2001:db8:85a3::8a2e:370:7334', 1234) - - """ - if address[0] == '[': - # Escaped ipv6 - _host, _port = address[1:].split(']') - host = _host - if ':' in _port: - port = _port.split(':')[1] - else: - port = default_port - else: - if address.count(':') == 1: - host, port = address.split(':') - else: - # 0 means ipv4, >1 means ipv6. - # We prohibit unescaped ipv6 addresses with port. - host = address - port = default_port - - return (host, None if port is None else int(port)) - - -def urlsplit(url, scheme='', allow_fragments=True): - """Parse a URL using urlparse.urlsplit(), splitting query and fragments. - This function papers over Python issue9374 when needed. - - The parameters are the same as urlparse.urlsplit. - """ - scheme, netloc, path, query, fragment = parse.urlsplit( - url, scheme, allow_fragments) - if allow_fragments and '#' in path: - path, fragment = path.split('#', 1) - if '?' in path: - path, query = path.split('?', 1) - return SplitResult(scheme, netloc, path, query, fragment) diff --git a/tools/install_venv_common.py b/tools/install_venv_common.py index 3e8c1e4a8..8ad037561 100644 --- a/tools/install_venv_common.py +++ b/tools/install_venv_common.py @@ -19,7 +19,6 @@ virtual environments. Since this script is used to bootstrap a virtualenv from the system's Python environment, it should be kept strictly compatible with Python 2.6. -Synced in from openstack-common """ from __future__ import print_function