ryu/flags: rename config paramerters related to openstack

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Yoshihiro Kaneko 2013-07-10 21:34:17 +09:00 committed by FUJITA Tomonori
parent cfa7c91f0b
commit 673b83b6d6
2 changed files with 38 additions and 30 deletions

View File

@ -50,12 +50,12 @@ CONF = cfg.CONF
def _get_auth_token(logger):
httpclient = q_client.HTTPClient(
username=CONF.quantum_admin_username,
tenant_name=CONF.quantum_admin_tenant_name,
password=CONF.quantum_admin_password,
auth_url=CONF.quantum_admin_auth_url,
timeout=CONF.quantum_url_timeout,
auth_strategy=CONF.quantum_auth_strategy)
username=CONF.neutron_admin_username,
tenant_name=CONF.neutron_admin_tenant_name,
password=CONF.neutron_admin_password,
auth_url=CONF.neutron_admin_auth_url,
timeout=CONF.neutron_url_timeout,
auth_strategy=CONF.neutron_auth_strategy)
try:
httpclient.authenticate()
except (q_exc.Unauthorized, q_exc.Forbidden, q_exc.EndpointNotFound) as e:
@ -68,12 +68,12 @@ def _get_auth_token(logger):
def _get_quantum_client(token):
if token:
my_client = q_clientv2.Client(
endpoint_url=CONF.quantum_url,
token=token, timeout=CONF.quantum_url_timeout)
endpoint_url=CONF.neutron_url,
token=token, timeout=CONF.neutron_url_timeout)
else:
my_client = q_clientv2.Client(
endpoint_url=CONF.quantum_url,
auth_strategy=None, timeout=CONF.quantum_url_timeout)
endpoint_url=CONF.neutron_url,
auth_strategy=None, timeout=CONF.neutron_url_timeout)
return my_client
@ -133,7 +133,7 @@ class OVSSwitch(object):
def __init__(self, dpid, nw, ifaces, logger):
# TODO: clean up
token = None
if CONF.quantum_auth_strategy:
if CONF.neutron_auth_strategy:
token = _get_auth_token(logger)
q_api = _get_quantum_client(token)
@ -142,9 +142,9 @@ class OVSSwitch(object):
self.ifaces = ifaces
self.logger = logger
self.q_api = q_api
self.ctrl_addr = CONF.quantum_controller_addr
self.ctrl_addr = CONF.neutron_controller_addr
if not self.ctrl_addr:
raise ValueError('option quantum_controler_addr must be speicfied')
raise ValueError('option neutron_controler_addr must be speicfied')
self.ovsdb_addr = None
self.tunnel_ip = None

View File

@ -23,22 +23,30 @@ CONF = cfg.CONF
CONF.register_cli_opts([
# app/quantum_adapter
cfg.StrOpt('quantum-url', default='http://localhost:9696',
help='URL for connecting to quantum'),
cfg.IntOpt('quantum-url-timeout', default=30,
help='timeout value for connecting to quantum in seconds'),
cfg.StrOpt('quantum-admin-username', default='quantum',
help='username for connecting to quantum in admin context'),
cfg.StrOpt('quantum-admin-password', default='service_password',
help='password for connecting to quantum in admin context'),
cfg.StrOpt('quantum-admin-tenant-name', default='service',
help='tenant name for connecting to quantum in admin context'),
cfg.StrOpt('quantum-admin-auth-url', default='http://localhost:5000/v2.0',
help='auth url for connecting to quantum in admin context'),
cfg.StrOpt('quantum-auth-strategy', default='keystone',
help='auth strategy for connecting to quantum in admin'
'context'),
cfg.StrOpt('quantum-controller-addr', default=None,
cfg.StrOpt('neutron-url', default='http://localhost:9696',
help='URL for connecting to neutron',
deprecated_name='quantum-url'),
cfg.IntOpt('neutron-url-timeout', default=30,
help='timeout value for connecting to neutron in seconds',
deprecated_name='quantum-url-timeout'),
cfg.StrOpt('neutron-admin-username', default='neutron',
help='username for connecting to neutron in admin context',
deprecated_name='quantum-admin-username'),
cfg.StrOpt('neutron-admin-password', default='service_password',
help='password for connecting to neutron in admin context',
deprecated_name='quantum-admin-password'),
cfg.StrOpt('neutron-admin-tenant-name', default='service',
help='tenant name for connecting to neutron in admin context',
deprecated_name='quantum-admin-tenant-name'),
cfg.StrOpt('neutron-admin-auth-url', default='http://localhost:5000/v2.0',
help='auth url for connecting to neutron in admin context',
deprecated_name='quantum-admin-auth-url'),
cfg.StrOpt('neutron-auth-strategy', default='keystone',
help='auth strategy for connecting to neutron in admin'
'context',
deprecated_name='quantum-auth-strategy'),
cfg.StrOpt('neutron-controller-addr', default=None,
help='openflow method:address:port to set controller of'
'ovs bridge')
'ovs bridge',
deprecated_name='quantum-controller-addr')
])