Renaming gbp package to gbpservice

Top level gbp directory is renamed to gbpservice. This results
in a changes to all gbp imports and other build artifacts.

Change-Id: I87cbb7c91b4206c1b8a0caa4ab7a7dc2e8f3e25e
Closes-bug: 1406623
This commit is contained in:
Sumit Naiksatam 2014-12-31 01:06:31 -08:00
parent d539fb77e4
commit 67b74e0aec
122 changed files with 240 additions and 203 deletions

View File

@ -24,8 +24,9 @@ from neutron.openstack.common import log as logging
from neutron.openstack.common import uuidutils from neutron.openstack.common import uuidutils
from neutron.plugins.common import constants from neutron.plugins.common import constants
from gbp.neutron.extensions import group_policy as gpolicy from gbpservice.neutron.extensions import group_policy as gpolicy
from gbp.neutron.services.grouppolicy.common import constants as gp_constants from gbpservice.neutron.services.grouppolicy.common import (
constants as gp_constants)
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,7 +18,7 @@ from neutron.db import model_base
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.openstack.common import uuidutils from neutron.openstack.common import uuidutils
from gbp.neutron.db.grouppolicy import group_policy_db as gpdb from gbpservice.neutron.db.grouppolicy import group_policy_db as gpdb
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,7 +19,7 @@ from oslo.db.sqlalchemy import session
import sqlalchemy as sa import sqlalchemy as sa
from sqlalchemy import event from sqlalchemy import event
from gbp.neutron.db.migration.models import head # noqa from gbpservice.neutron.db.migration.models import head # noqa
# Mirror of the Neutron's env, plus some tweaks in order to set cross DB # Mirror of the Neutron's env, plus some tweaks in order to set cross DB
# FKs. # FKs.

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
# #
"""gbp-classifiers_actions_rules """gbp_classifiers_actions_rules
Revision ID: 4ae51f13395a Revision ID: 4ae51f13395a
Create Date: 2014-07-30 14:16:05.660561 Create Date: 2014-07-30 14:16:05.660561
@ -29,7 +29,8 @@ from alembic import op
from neutron.plugins.common import constants from neutron.plugins.common import constants
import sqlalchemy as sa import sqlalchemy as sa
from gbp.neutron.services.grouppolicy.common import constants as gp_constants from gbpservice.neutron.services.grouppolicy.common import (
constants as gp_constants)
def upgrade(active_plugins=None, options=None): def upgrade(active_plugins=None, options=None):

View File

@ -16,8 +16,9 @@ from neutron.db.migration.cli import * # noqa
def main(): def main():
config = alembic_config.Config( config = alembic_config.Config(
os.path.join(os.path.dirname(__file__), 'alembic.ini')) os.path.join(os.path.dirname(__file__), 'alembic.ini'))
config.set_main_option('script_location', config.set_main_option(
'gbp.neutron.db.migration:alembic_migrations') 'script_location',
'gbpservice.neutron.db.migration:alembic_migrations')
config.neutron_config = CONF config.neutron_config = CONF
CONF() CONF()
CONF.command.func(config, CONF.command.name) CONF.command.func(config, CONF.command.name)

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
from gbp.neutron.db.grouppolicy import group_policy_db # noqa from gbpservice.neutron.db.grouppolicy import group_policy_db # noqa
from gbp.neutron.db.grouppolicy import group_policy_mapping_db # noqa from gbpservice.neutron.db.grouppolicy import group_policy_mapping_db # noqa
from neutron.db import model_base from neutron.db import model_base

View File

@ -23,7 +23,7 @@ from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.openstack.common import uuidutils from neutron.openstack.common import uuidutils
from gbp.neutron.extensions import servicechain as schain from gbpservice.neutron.extensions import servicechain as schain
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
MAX_IPV4_SUBNET_PREFIX_LENGTH = 31 MAX_IPV4_SUBNET_PREFIX_LENGTH = 31

View File

@ -23,14 +23,15 @@ from neutron.openstack.common import uuidutils
from neutron.plugins.common import constants from neutron.plugins.common import constants
from neutron.services import service_base from neutron.services import service_base
import gbp.neutron.extensions import gbpservice.neutron.extensions
from gbp.neutron.services.grouppolicy.common import constants as gp_constants from gbpservice.neutron.services.grouppolicy.common import (
constants as gp_constants)
# The code below is a monkey patch of key Neutron's modules. This is needed for # The code below is a monkey patch of key Neutron's modules. This is needed for
# the GBP service to be loaded correctly. GBP extensions' path is added # the GBP service to be loaded correctly. GBP extensions' path is added
# to Neutron's so that it's found at extension scanning time. # to Neutron's so that it's found at extension scanning time.
extensions.append_api_extensions_path(gbp.neutron.extensions.__path__) extensions.append_api_extensions_path(gbpservice.neutron.extensions.__path__)
constants.GROUP_POLICY = "GROUP_POLICY" constants.GROUP_POLICY = "GROUP_POLICY"
constants.COMMON_PREFIXES["GROUP_POLICY"] = "/grouppolicy" constants.COMMON_PREFIXES["GROUP_POLICY"] = "/grouppolicy"
constants.EXT_TO_SERVICE_MAPPING['gp'] = constants.GROUP_POLICY constants.EXT_TO_SERVICE_MAPPING['gp'] = constants.GROUP_POLICY

View File

@ -12,7 +12,7 @@
from neutron.api.v2 import attributes as attr from neutron.api.v2 import attributes as attr
from gbp.neutron.extensions import group_policy as gp from gbpservice.neutron.extensions import group_policy as gp
# Extended attributes for Group Policy resource to map to Neutron constructs # Extended attributes for Group Policy resource to map to Neutron constructs

View File

@ -23,13 +23,13 @@ from neutron.openstack.common import log as logging
from neutron.plugins.common import constants from neutron.plugins.common import constants
from neutron.services import service_base from neutron.services import service_base
import gbp.neutron.extensions import gbpservice.neutron.extensions
# The code below is a monkey patch of key Neutron's modules. This is needed for # The code below is a monkey patch of key Neutron's modules. This is needed for
# the GBP service to be loaded correctly. GBP extensions' path is added # the GBP service to be loaded correctly. GBP extensions' path is added
# to Neutron's so that it's found at extension scanning time. # to Neutron's so that it's found at extension scanning time.
extensions.append_api_extensions_path(gbp.neutron.extensions.__path__) extensions.append_api_extensions_path(gbpservice.neutron.extensions.__path__)
constants.SERVICECHAIN = "SERVICECHAIN" constants.SERVICECHAIN = "SERVICECHAIN"
constants.COMMON_PREFIXES["SERVICECHAIN"] = "/servicechain" constants.COMMON_PREFIXES["SERVICECHAIN"] = "/servicechain"

View File

@ -17,7 +17,8 @@ from neutron.common import constants as n_constants
from neutron.openstack.common import log from neutron.openstack.common import log
from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2 import driver_api as api
from gbp.neutron.services.grouppolicy.drivers.cisco.apic import apic_mapping from gbpservice.neutron.services.grouppolicy.drivers.cisco.apic import (
apic_mapping as amap)
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
@ -30,7 +31,7 @@ class APICMechanismGBPDriver(api.MechanismDriver):
@property @property
def apic_gbp(self): def apic_gbp(self):
if not self._apic_gbp: if not self._apic_gbp:
self._apic_gbp = (apic_mapping.ApicMappingDriver. self._apic_gbp = (amap.ApicMappingDriver.
get_initialized_instance()) get_initialized_instance())
return self._apic_gbp return self._apic_gbp

View File

@ -16,7 +16,7 @@
from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2 import driver_api as api
from neutron.plugins.nuage.common import constants as nuage_const from neutron.plugins.nuage.common import constants as nuage_const
from gbp.neutron.services.grouppolicy.drivers.nuage import driver from gbpservice.neutron.services.grouppolicy.drivers.nuage import driver
class NuageMechanismGBPDriver(api.MechanismDriver): class NuageMechanismGBPDriver(api.MechanismDriver):
@ -28,7 +28,7 @@ class NuageMechanismGBPDriver(api.MechanismDriver):
def nuage_gbp(self): def nuage_gbp(self):
if not self._nuage_gbp: if not self._nuage_gbp:
self._nuage_gbp = (driver.NuageGBPDriver. self._nuage_gbp = (driver.NuageGBPDriver.
get_initialized_instance()) get_initialized_instance())
return self._nuage_gbp return self._nuage_gbp
def update_port_postcommit(self, context): def update_port_postcommit(self, context):

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from gbp.neutron.services.grouppolicy.drivers.odl import odl_mapping from gbpservice.neutron.services.grouppolicy.drivers.odl import odl_mapping
from neutron.common import constants as n_constants from neutron.common import constants as n_constants
from neutron.extensions import portbindings from neutron.extensions import portbindings
from neutron.openstack.common import log from neutron.openstack.common import log
@ -71,4 +71,4 @@ class OdlMechanismGBPDriver(api.MechanismDriver):
False to indicate this to callers. False to indicate this to callers.
""" """
network_type = segment[api.NETWORK_TYPE] network_type = segment[api.NETWORK_TYPE]
return network_type in [constants.TYPE_VXLAN, ] return network_type in [constants.TYPE_VXLAN, ]

View File

@ -18,12 +18,13 @@ group_policy_opts = [
default=['dummy'], default=['dummy'],
help=_("An ordered list of group policy driver " help=_("An ordered list of group policy driver "
"entrypoints to be loaded from the " "entrypoints to be loaded from the "
"gbp.neutron.group_policy.policy_drivers namespace.")), "gbpservice.neutron.group_policy.policy_drivers "
"namespace.")),
cfg.ListOpt('extension_drivers', cfg.ListOpt('extension_drivers',
default=[], default=[],
help=_("An ordered list of extension driver " help=_("An ordered list of extension driver "
"entrypoints to be loaded from the " "entrypoints to be loaded from the "
"gbp.neutron.group_policy.extension_drivers " "gbpservice.neutron.group_policy.extension_drivers "
"namespace.")), "namespace.")),
] ]

View File

@ -24,10 +24,11 @@ from neutron.plugins.ml2.drivers.cisco.apic import config
from neutron.plugins.ml2 import models from neutron.plugins.ml2 import models
from oslo.config import cfg from oslo.config import cfg
from gbp.neutron.db.grouppolicy import group_policy_mapping_db as gpdb from gbpservice.neutron.db.grouppolicy import group_policy_mapping_db as gpdb
from gbp.neutron.services.grouppolicy.common import constants as g_const from gbpservice.neutron.services.grouppolicy.common import constants as g_const
from gbp.neutron.services.grouppolicy.common import exceptions as gpexc from gbpservice.neutron.services.grouppolicy.common import exceptions as gpexc
from gbp.neutron.services.grouppolicy.drivers import resource_mapping as api from gbpservice.neutron.services.grouppolicy.drivers import (
resource_mapping as api)
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -12,7 +12,8 @@
from neutron.common import log from neutron.common import log
from gbp.neutron.services.grouppolicy import group_policy_driver_api as api from gbpservice.neutron.services.grouppolicy import (
group_policy_driver_api as api)
class NoopDriver(api.PolicyDriver): class NoopDriver(api.PolicyDriver):

View File

@ -17,8 +17,9 @@ from neutron.common import log
from neutron.db import model_base from neutron.db import model_base
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from gbp.neutron.services.grouppolicy.common import exceptions as exc from gbpservice.neutron.services.grouppolicy import (
from gbp.neutron.services.grouppolicy import group_policy_driver_api as api group_policy_driver_api as api)
from gbpservice.neutron.services.grouppolicy.common import exceptions as exc
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -16,8 +16,9 @@ from neutron.openstack.common import importutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from oslo.config import cfg from oslo.config import cfg
from gbp.neutron.services.grouppolicy.drivers.nuage.common import config from gbpservice.neutron.services.grouppolicy.drivers import (
from gbp.neutron.services.grouppolicy.drivers import resource_mapping as api resource_mapping as api)
from gbpservice.neutron.services.grouppolicy.drivers.nuage.common import config
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,18 +18,22 @@ from oslo.serialization import jsonutils
from requests import auth from requests import auth
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
cfg.CONF.import_opt('odl_username', cfg.CONF.import_opt(
'gbp.neutron.services.grouppolicy.drivers.odl.config', 'odl_username',
group='odl_driver') 'gbpservice.neutron.services.grouppolicy.drivers.odl.config',
cfg.CONF.import_opt('odl_password', group='odl_driver')
'gbp.neutron.services.grouppolicy.drivers.odl.config', cfg.CONF.import_opt(
group='odl_driver') 'odl_password',
cfg.CONF.import_opt('odl_host', 'gbpservice.neutron.services.grouppolicy.drivers.odl.config',
'gbp.neutron.services.grouppolicy.drivers.odl.config', group='odl_driver')
group='odl_driver') cfg.CONF.import_opt(
cfg.CONF.import_opt('odl_port', 'odl_host',
'gbp.neutron.services.grouppolicy.drivers.odl.config', 'gbpservice.neutron.services.grouppolicy.drivers.odl.config',
group='odl_driver') group='odl_driver')
cfg.CONF.import_opt(
'odl_port',
'gbpservice.neutron.services.grouppolicy.drivers.odl.config',
group='odl_driver')
class OdlManager(object): class OdlManager(object):
@ -230,4 +234,4 @@ class OdlManager(object):
"id": tenant_id "id": tenant_id
} }
if not self._is_tenant_created(tenant_id): if not self._is_tenant_created(tenant_id):
self.create_update_tenant(tenant_id, tenant) self.create_update_tenant(tenant_id, tenant)

View File

@ -12,16 +12,18 @@
import uuid import uuid
from gbp.neutron.db.grouppolicy import group_policy_mapping_db as gpdb
from gbp.neutron.services.grouppolicy.common import constants as g_const
from gbp.neutron.services.grouppolicy.common import exceptions as gpexc
from gbp.neutron.services.grouppolicy.drivers.odl import odl_manager
from gbp.neutron.services.grouppolicy.drivers import resource_mapping as api
from neutron import manager from neutron import manager
from neutron.openstack.common import lockutils # noqa from neutron.openstack.common import lockutils # noqa
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.common import constants from neutron.plugins.common import constants
from gbpservice.neutron.db.grouppolicy import group_policy_mapping_db as gpdb
from gbpservice.neutron.services.grouppolicy.common import constants as g_const
from gbpservice.neutron.services.grouppolicy.common import exceptions as gpexc
from gbpservice.neutron.services.grouppolicy.drivers import (
resource_mapping as api)
from gbpservice.neutron.services.grouppolicy.drivers.odl import odl_manager
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -19,7 +19,7 @@ import urlparse
from oslo.config import cfg from oslo.config import cfg
from gbp.neutron.services.grouppolicy.common import exceptions from gbpservice.neutron.services.grouppolicy.common import exceptions
from neutron.openstack.common import jsonutils from neutron.openstack.common import jsonutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging

View File

@ -12,9 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from gbp.neutron.services.grouppolicy.drivers import ( from gbpservice.neutron.services.grouppolicy.drivers import (
resource_mapping as res_map) resource_mapping as res_map)
from gbp.neutron.services.grouppolicy.drivers.oneconvergence import ( from gbpservice.neutron.services.grouppolicy.drivers.oneconvergence import (
nvsd_gbp_api as api) nvsd_gbp_api as api)
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc

View File

@ -29,11 +29,12 @@ from neutron.plugins.common import constants as pconst
from oslo.config import cfg from oslo.config import cfg
import sqlalchemy as sa import sqlalchemy as sa
from gbp.neutron.db.grouppolicy import group_policy_db as gpdb from gbpservice.neutron.db.grouppolicy import group_policy_db as gpdb
from gbp.neutron.db import servicechain_db # noqa from gbpservice.neutron.db import servicechain_db # noqa
from gbp.neutron.services.grouppolicy.common import constants as gconst from gbpservice.neutron.services.grouppolicy import (
from gbp.neutron.services.grouppolicy.common import exceptions as exc group_policy_driver_api as api)
from gbp.neutron.services.grouppolicy import group_policy_driver_api as api from gbpservice.neutron.services.grouppolicy.common import constants as gconst
from gbpservice.neutron.services.grouppolicy.common import exceptions as exc
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -29,7 +29,7 @@ class ExtensionManager(stevedore.named.NamedExtensionManager):
LOG.info(_("Configured extension driver names: %s"), LOG.info(_("Configured extension driver names: %s"),
cfg.CONF.group_policy.extension_drivers) cfg.CONF.group_policy.extension_drivers)
super(ExtensionManager, self).__init__( super(ExtensionManager, self).__init__(
'gbp.neutron.group_policy.extension_drivers', 'gbpservice.neutron.group_policy.extension_drivers',
cfg.CONF.group_policy.extension_drivers, cfg.CONF.group_policy.extension_drivers,
invoke_on_load=True, invoke_on_load=True,
name_order=True) name_order=True)

View File

@ -10,7 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from gbp.neutron.services.grouppolicy import group_policy_driver_api as api from gbpservice.neutron.services.grouppolicy import (
group_policy_driver_api as api)
class GroupPolicyContext(object): class GroupPolicyContext(object):
@ -268,4 +269,4 @@ class ExternalPolicyContext(BaseResouceContext, api.ExternalPolicyContext):
class NatPoolContext(BaseResouceContext, api.NatPoolContext): class NatPoolContext(BaseResouceContext, api.NatPoolContext):
pass pass

View File

@ -17,13 +17,16 @@ from neutron.common import log
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from gbp.neutron.db.grouppolicy import group_policy_db as gdb from gbpservice.neutron.db.grouppolicy import group_policy_db as gdb
from gbp.neutron.db.grouppolicy import group_policy_mapping_db from gbpservice.neutron.db.grouppolicy import group_policy_mapping_db
from gbp.neutron.extensions import group_policy as gpex from gbpservice.neutron.extensions import group_policy as gpex
from gbp.neutron.services.grouppolicy.common import exceptions as gp_exc from gbpservice.neutron.services.grouppolicy import (
from gbp.neutron.services.grouppolicy import extension_manager as ext_manager extension_manager as ext_manager)
from gbp.neutron.services.grouppolicy import group_policy_context as p_context from gbpservice.neutron.services.grouppolicy import (
from gbp.neutron.services.grouppolicy import policy_driver_manager as manager group_policy_context as p_context)
from gbpservice.neutron.services.grouppolicy import (
policy_driver_manager as manager)
from gbpservice.neutron.services.grouppolicy.common import exceptions as gp_exc
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -15,12 +15,12 @@ from oslo.config import cfg
import stevedore import stevedore
from gbp.neutron.services.grouppolicy.common import exceptions as gp_exc from gbpservice.neutron.services.grouppolicy.common import exceptions as gp_exc
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
cfg.CONF.import_opt('policy_drivers', cfg.CONF.import_opt('policy_drivers',
'gbp.neutron.services.grouppolicy.config', 'gbpservice.neutron.services.grouppolicy.config',
group='group_policy') group='group_policy')
@ -66,7 +66,7 @@ class PolicyDriverManager(stevedore.named.NamedExtensionManager):
LOG.info(_("Configured policy driver names: %s"), LOG.info(_("Configured policy driver names: %s"),
cfg.CONF.group_policy.policy_drivers) cfg.CONF.group_policy.policy_drivers)
super(PolicyDriverManager, super(PolicyDriverManager,
self).__init__('gbp.neutron.group_policy.policy_drivers', self).__init__('gbpservice.neutron.group_policy.policy_drivers',
cfg.CONF.group_policy.policy_drivers, cfg.CONF.group_policy.policy_drivers,
invoke_on_load=True, invoke_on_load=True,
name_order=True) name_order=True)

View File

@ -18,7 +18,7 @@ service_chain_opts = [
default=['dummy'], default=['dummy'],
help=_("An ordered list of service chain drivers " help=_("An ordered list of service chain drivers "
"entrypoints to be loaded from the " "entrypoints to be loaded from the "
"gbp.neutron.servicechain.servicechain_drivers " "gbpservice.neutron.servicechain.servicechain_drivers "
"namespace.")), "namespace.")),
cfg.StrOpt('heat_uri', cfg.StrOpt('heat_uri',
default='http://localhost:8004/v1', default='http://localhost:8004/v1',

View File

@ -14,12 +14,13 @@ from neutron.openstack.common import log
from oslo.config import cfg from oslo.config import cfg
import stevedore import stevedore
from gbp.neutron.services.servicechain.common import exceptions as sc_exc from gbpservice.neutron.services.servicechain.common import (
exceptions as sc_exc)
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
cfg.CONF.import_opt('servicechain_drivers', cfg.CONF.import_opt('servicechain_drivers',
'gbp.neutron.services.servicechain.config', 'gbpservice.neutron.services.servicechain.config',
group='servicechain') group='servicechain')
@ -38,10 +39,10 @@ class DriverManager(stevedore.named.NamedExtensionManager):
LOG.info(_("Configured servicechain driver names: %s"), LOG.info(_("Configured servicechain driver names: %s"),
cfg.CONF.servicechain.servicechain_drivers) cfg.CONF.servicechain.servicechain_drivers)
super(DriverManager, super(DriverManager,
self).__init__('gbp.neutron.servicechain.servicechain_drivers', self).__init__(
cfg.CONF.servicechain.servicechain_drivers, 'gbpservice.neutron.servicechain.servicechain_drivers',
invoke_on_load=True, cfg.CONF.servicechain.servicechain_drivers,
name_order=True) invoke_on_load=True, name_order=True)
LOG.info(_("Loaded servicechain driver names: %s"), self.names()) LOG.info(_("Loaded servicechain driver names: %s"), self.names())
self._register_drivers() self._register_drivers()

View File

@ -23,9 +23,9 @@ from neutron.openstack.common import log as logging
from oslo.config import cfg from oslo.config import cfg
import sqlalchemy as sa import sqlalchemy as sa
from gbp.neutron.services.grouppolicy.drivers.oneconvergence import\ from gbpservice.neutron.services.grouppolicy.drivers.oneconvergence import (
nvsd_gbp_api nvsd_gbp_api as napi)
from gbp.neutron.services.servicechain.drivers import simplechain_driver from gbpservice.neutron.services.servicechain.drivers import simplechain_driver
eventlet.monkey_patch() eventlet.monkey_patch()
@ -75,7 +75,7 @@ class OneconvergenceServiceChainDriver(simplechain_driver.SimpleChainDriver):
def __init__(self): def __init__(self):
self.pending_chain_insertions = list() self.pending_chain_insertions = list()
self.nvsd_api = nvsd_gbp_api.NVSDServiceApi() self.nvsd_api = napi.NVSDServiceApi()
@log.log @log.log
def create_servicechain_spec_precommit(self, context): def create_servicechain_spec_precommit(self, context):
@ -152,14 +152,14 @@ class OneconvergenceServiceChainDriver(simplechain_driver.SimpleChainDriver):
stack_template = jsonutils.loads(stack_template) stack_template = jsonutils.loads(stack_template)
config_param_values = sc_instance.get('config_param_values', {}) config_param_values = sc_instance.get('config_param_values', {})
stack_params = {} stack_params = {}
#config_param_values has the parameters for all Nodes. Only apply # config_param_values has the parameters for all Nodes. Only apply
#the ones relevant for this Node # the ones relevant for this Node
if config_param_values: if config_param_values:
config_param_values = jsonutils.loads(config_param_values) config_param_values = jsonutils.loads(config_param_values)
config_param_names = sc_spec.get('config_param_names', []) config_param_names = sc_spec.get('config_param_names', [])
if config_param_names: if config_param_names:
config_param_names = ast.literal_eval(config_param_names) config_param_names = ast.literal_eval(config_param_names)
#TODO(magesh):Process on the basis of ResourceType rather than Name # TODO(magesh):Process on the basis of ResourceType rather than Name
provider_ptg_id = sc_instance.get("provider_ptg_id") provider_ptg_id = sc_instance.get("provider_ptg_id")
node_params = (stack_template.get('Parameters') node_params = (stack_template.get('Parameters')
or stack_template.get('parameters')) or stack_template.get('parameters'))
@ -168,12 +168,12 @@ class OneconvergenceServiceChainDriver(simplechain_driver.SimpleChainDriver):
for key in list(set(config_param_names) & set(node_params.keys())): for key in list(set(config_param_names) & set(node_params.keys())):
if key == "PoolMemberIPs": if key == "PoolMemberIPs":
value = self._get_member_ips(context, provider_ptg_id) value = self._get_member_ips(context, provider_ptg_id)
#TODO(Magesh):Return one value for now # TODO(Magesh):Return one value for now
value = value[0] if value else "" value = value[0] if value else ""
config_param_values[key] = value config_param_values[key] = value
elif key == "pool_member_port": elif key == "pool_member_port":
value = self._get_member_ports(context, provider_ptg_id) value = self._get_member_ports(context, provider_ptg_id)
#TODO(Magesh):Return one value for now # TODO(Magesh):Return one value for now
value = value[0] if value else "" value = value[0] if value else ""
config_param_values[key] = value config_param_values[key] = value
elif key == "Subnet": elif key == "Subnet":

View File

@ -22,7 +22,7 @@ from oslo.config import cfg
import sqlalchemy as sa import sqlalchemy as sa
from gbp.neutron.services.servicechain.common import exceptions as exc from gbpservice.neutron.services.servicechain.common import exceptions as exc
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -14,11 +14,13 @@ from neutron.common import log
from neutron.openstack.common import excutils from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
import gbp.neutron.db.servicechain_db as servicechain_db import gbpservice.neutron.db.servicechain_db as servicechain_db
from gbp.neutron.services.servicechain.common import exceptions as sc_exc from gbpservice.neutron.services.servicechain import (
from gbp.neutron.services.servicechain import driver_manager as manager driver_manager as manager)
from gbp.neutron.services.servicechain import servicechain_context as \ from gbpservice.neutron.services.servicechain import (
servicechain_context servicechain_context as servicechain_context)
from gbpservice.neutron.services.servicechain.common import (
exceptions as sc_exc)
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -299,4 +299,4 @@ def get_resource_plural(resource):
else: else:
resource_plural = resource + 's' resource_plural = resource + 's'
return resource_plural return resource_plural

View File

@ -24,10 +24,10 @@ from neutron.tests.unit import test_db_plugin
from neutron.tests.unit import test_extensions from neutron.tests.unit import test_extensions
from oslo.config import cfg from oslo.config import cfg
from gbp.neutron.db.grouppolicy import group_policy_db as gpdb from gbpservice.neutron.db.grouppolicy import group_policy_db as gpdb
import gbp.neutron.extensions import gbpservice.neutron.extensions
from gbp.neutron.extensions import group_policy as gpolicy from gbpservice.neutron.extensions import group_policy as gpolicy
from gbp.neutron.tests.unit import common as cm from gbpservice.neutron.tests.unit import common as cm
JSON_FORMAT = 'json' JSON_FORMAT = 'json'
@ -168,7 +168,8 @@ class GroupPolicyDbTestCase(GroupPolicyDBTestBase,
def setUp(self, core_plugin=None, gp_plugin=None, service_plugins=None, def setUp(self, core_plugin=None, gp_plugin=None, service_plugins=None,
ext_mgr=None): ext_mgr=None):
extensions.append_api_extensions_path(gbp.neutron.extensions.__path__) extensions.append_api_extensions_path(
gbpservice.neutron.extensions.__path__)
if not gp_plugin: if not gp_plugin:
gp_plugin = DB_GP_PLUGIN_KLASS gp_plugin = DB_GP_PLUGIN_KLASS
self.plugin = importutils.import_object(gp_plugin) self.plugin = importutils.import_object(gp_plugin)

View File

@ -17,8 +17,9 @@ import webob.exc
from neutron.tests.unit import test_l3_plugin from neutron.tests.unit import test_l3_plugin
from neutron.tests.unit import testlib_api from neutron.tests.unit import testlib_api
from gbp.neutron.db.grouppolicy import group_policy_mapping_db as gpmdb from gbpservice.neutron.db.grouppolicy import group_policy_mapping_db as gpmdb
from gbp.neutron.tests.unit.db.grouppolicy import test_group_policy_db as tgpdb from gbpservice.neutron.tests.unit.db.grouppolicy import (
test_group_policy_db as tgpdb)
class GroupPolicyMappingDBTestPlugin(gpmdb.GroupPolicyMappingDbPlugin): class GroupPolicyMappingDBTestPlugin(gpmdb.GroupPolicyMappingDbPlugin):
@ -30,7 +31,8 @@ DB_GP_PLUGIN_KLASS = (GroupPolicyMappingDBTestPlugin.__module__ + '.' +
GroupPolicyMappingDBTestPlugin.__name__) GroupPolicyMappingDBTestPlugin.__name__)
SC_PLUGIN_KLASS = ( SC_PLUGIN_KLASS = (
"gbp.neutron.services.servicechain.servicechain_plugin.ServiceChainPlugin" "gbpservice.neutron.services.servicechain.servicechain_plugin."
"ServiceChainPlugin"
) )

View File

@ -21,9 +21,9 @@ from neutron.plugins.common import constants
from neutron.tests.unit import test_db_plugin from neutron.tests.unit import test_db_plugin
from neutron.tests.unit import test_extensions from neutron.tests.unit import test_extensions
from gbp.neutron.db import servicechain_db as svcchain_db from gbpservice.neutron.db import servicechain_db as svcchain_db
import gbp.neutron.extensions import gbpservice.neutron.extensions
from gbp.neutron.extensions import servicechain as service_chain from gbpservice.neutron.extensions import servicechain as service_chain
JSON_FORMAT = 'json' JSON_FORMAT = 'json'
@ -212,7 +212,8 @@ class ServiceChainDbTestCase(ServiceChainDBTestBase,
def setUp(self, core_plugin=None, sc_plugin=None, service_plugins=None, def setUp(self, core_plugin=None, sc_plugin=None, service_plugins=None,
ext_mgr=None): ext_mgr=None):
extensions.append_api_extensions_path(gbp.neutron.extensions.__path__) extensions.append_api_extensions_path(
gbpservice.neutron.extensions.__path__)
if not sc_plugin: if not sc_plugin:
sc_plugin = DB_GP_PLUGIN_KLASS sc_plugin = DB_GP_PLUGIN_KLASS
self.plugin = importutils.import_object(sc_plugin) self.plugin = importutils.import_object(sc_plugin)

Some files were not shown because too many files have changed in this diff Show More