From 926a3048ba0fdd232ac0b07506745b62de4de2c6 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 19 Oct 2015 21:49:31 +0900 Subject: [PATCH] Remove repos.py replacement Remove neutron_taas/neutron_dependencies/repos.py as it's stale. As we don't use service_provider and ServiceTypeManager, explicit registration (add_provider_configuration) is not necessary. Partial-Bug: #1501793 Change-Id: I31c2aa9af510d839bb88d9163aa623abb79b3567 --- install.sh | 8 -- neutron_taas/neutron_dependencies/repos.py | 102 --------------------- 2 files changed, 110 deletions(-) delete mode 100644 neutron_taas/neutron_dependencies/repos.py diff --git a/install.sh b/install.sh index 442388cf..a6a1e9f3 100755 --- a/install.sh +++ b/install.sh @@ -35,14 +35,6 @@ if [ "$COMMAND" = "install_plugin" ] || [ "$COMMAND" = "install_agent" ]; then exit 1 fi - cp ./neutron_taas/neutron_dependencies/repos.py $DEVSTACK_PATH/neutron/common/repos.py - if [ $? = 0 ]; then - echo "Copied the common/repos.py file...." - else - echo "Install failed while copying repos.py file" - exit 1 - fi - # patch the neutron.conf file to support TaaS plugin ./neutron_taas/neutron_dependencies/patch_conf_file.sh ./neutron_taas/neutron_dependencies/taas.conf /etc/neutron/neutron.conf if [ $? = 0 ]; then diff --git a/neutron_taas/neutron_dependencies/repos.py b/neutron_taas/neutron_dependencies/repos.py deleted file mode 100644 index 7d9ab1b4..00000000 --- a/neutron_taas/neutron_dependencies/repos.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (c) 2015, A10 Networks -# -# 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 ConfigParser -import importlib -import os - -from oslo_config import cfg -from oslo_log import log as logging - -LOG = logging.getLogger(__name__) - - -class NeutronModules(object): - - MODULES = { - 'neutron_fwaas': { - 'alembic-name': 'fwaas', - }, - 'neutron_lbaas': { - 'alembic-name': 'lbaas', - }, - 'neutron_vpnaas': { - 'alembic-name': 'vpnaas', - }, - 'neutron_taas': { - 'alembic-name': 'taas', - }, - } - - def __init__(self): - self.repos = {} - for repo in self.MODULES: - self.repos[repo] = {} - self.repos[repo]['mod'] = self._import_or_none(repo) - self.repos[repo]['ini'] = None - - def _import_or_none(self, module): - try: - return importlib.import_module(module) - except ImportError: - return None - - def installed_list(self): - z = filter(lambda k: self.repos[k]['mod'] is not None, self.repos) - LOG.debug("NeutronModules related repos installed = %s", z) - return z - - def module(self, module): - return self.repos[module]['mod'] - - def alembic_name(self, module): - return self.MODULES[module]['alembic-name'] - - # Return an INI parser for the child module. oslo.config is a bit too - # magical in its INI loading, and in one notable case, we need to merge - # together the [service_providers] section across at least four - # repositories. - def ini(self, module): - if self.repos[module]['ini'] is None: - neutron_dir = None - try: - neutron_dir = cfg.CONF.config_dir - except cfg.NoSuchOptError: - pass - - if neutron_dir is None: - neutron_dir = '/etc/neutron' - - ini = ConfigParser.SafeConfigParser() - ini_path = os.path.join(neutron_dir, '%s.conf' % module) - if os.path.exists(ini_path): - ini.read(ini_path) - - self.repos[module]['ini'] = ini - - return self.repos[module]['ini'] - - def service_providers(self, module): - ini = self.ini(module) - - sp = [] - try: - for name, value in ini.items('service_providers'): - if name == 'service_provider': - sp.append(value) - except ConfigParser.NoSectionError: - pass - - return sp