¡@

Home 

OpenStack Study: config.py

OpenStack Index

**** CubicPower OpenStack Study ****

# vim: tabstop=4 shiftwidth=4 softtabstop=4

# Copyright 2012 VMware, Inc.

#

# 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.

from oslo.config import cfg

from neutron.plugins.vmware.common import exceptions as nsx_exc

**** CubicPower OpenStack Study ****

class ReplicationModes:

SERVICE = 'service'

SOURCE = 'source'

base_opts = [

cfg.IntOpt('max_lp_per_bridged_ls',

**** CubicPower OpenStack Study ****

def validate_config_options():

    if cfg.CONF.NSX.replication_mode not in (ReplicationModes.SERVICE,

                                             ReplicationModes.SOURCE):

        error = (_("Invalid replication_mode: %s") %

                 cfg.CONF.NSX.replication_mode)

        raise nsx_exc.NsxPluginException(err_msg=error)