Sync charm-helpers

This commit is contained in:
Corey Bryant 2015-04-15 15:22:21 +00:00
parent 244bdd27a8
commit 5b0d7ee658
7 changed files with 39 additions and 5 deletions

View File

@ -44,7 +44,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
Determine if the local branch being tested is derived from its Determine if the local branch being tested is derived from its
stable or next (dev) branch, and based on this, use the corresonding stable or next (dev) branch, and based on this, use the corresonding
stable or next branches for the other_services.""" stable or next branches for the other_services."""
base_charms = ['mysql', 'mongodb', 'rabbitmq-server'] base_charms = ['mysql', 'mongodb']
if self.stable: if self.stable:
for svc in other_services: for svc in other_services:

View File

@ -808,6 +808,19 @@ class NeutronContext(OSContextGenerator):
return ovs_ctxt return ovs_ctxt
def nuage_ctxt(self):
driver = neutron_plugin_attribute(self.plugin, 'driver',
self.network_manager)
config = neutron_plugin_attribute(self.plugin, 'config',
self.network_manager)
nuage_ctxt = {'core_plugin': driver,
'neutron_plugin': 'vsp',
'neutron_security_groups': self.neutron_security_groups,
'local_ip': unit_private_ip(),
'config': config}
return nuage_ctxt
def nvp_ctxt(self): def nvp_ctxt(self):
driver = neutron_plugin_attribute(self.plugin, 'driver', driver = neutron_plugin_attribute(self.plugin, 'driver',
self.network_manager) self.network_manager)
@ -891,6 +904,8 @@ class NeutronContext(OSContextGenerator):
ctxt.update(self.n1kv_ctxt()) ctxt.update(self.n1kv_ctxt())
elif self.plugin == 'Calico': elif self.plugin == 'Calico':
ctxt.update(self.calico_ctxt()) ctxt.update(self.calico_ctxt())
elif self.plugin == 'vsp':
ctxt.update(self.nuage_ctxt())
alchemy_flags = config('neutron-alchemy-flags') alchemy_flags = config('neutron-alchemy-flags')
if alchemy_flags: if alchemy_flags:

View File

@ -180,6 +180,19 @@ def neutron_plugins():
'nova-api-metadata']], 'nova-api-metadata']],
'server_packages': ['neutron-server', 'calico-control'], 'server_packages': ['neutron-server', 'calico-control'],
'server_services': ['neutron-server'] 'server_services': ['neutron-server']
},
'vsp': {
'config': '/etc/neutron/plugins/nuage/nuage_plugin.ini',
'driver': 'neutron.plugins.nuage.plugin.NuagePlugin',
'contexts': [
context.SharedDBContext(user=config('neutron-database-user'),
database=config('neutron-database'),
relation_prefix='neutron',
ssl_dir=NEUTRON_CONF_DIR)],
'services': [],
'packages': [],
'server_packages': ['neutron-server', 'neutron-plugin-nuage'],
'server_services': ['neutron-server']
} }
} }
if release >= 'icehouse': if release >= 'icehouse':

View File

@ -9,5 +9,9 @@ respawn
exec start-stop-daemon --start --chuid {{ user_name }} \ exec start-stop-daemon --start --chuid {{ user_name }} \
--chdir {{ start_dir }} --name {{ process_name }} \ --chdir {{ start_dir }} --name {{ process_name }} \
--exec {{ executable_name }} -- \ --exec {{ executable_name }} -- \
{% for config_file in config_files -%}
--config-file={{ config_file }} \ --config-file={{ config_file }} \
{% endfor -%}
{% if log_file -%}
--log-file={{ log_file }} --log-file={{ log_file }}
{% endif -%}

View File

@ -33,9 +33,9 @@ def bool_from_string(value):
value = value.strip().lower() value = value.strip().lower()
if value in ['y', 'yes', 'true', 't']: if value in ['y', 'yes', 'true', 't', 'on']:
return True return True
elif value in ['n', 'no', 'false', 'f']: elif value in ['n', 'no', 'false', 'f', 'off']:
return False return False
msg = "Unable to interpret string value '%s' as boolean" % (value) msg = "Unable to interpret string value '%s' as boolean" % (value)

View File

@ -118,6 +118,9 @@ class AmuletUtils(object):
longs, or can be a function that evaluate a variable and returns a longs, or can be a function that evaluate a variable and returns a
bool. bool.
""" """
self.log.debug('actual: {}'.format(repr(actual)))
self.log.debug('expected: {}'.format(repr(expected)))
for k, v in six.iteritems(expected): for k, v in six.iteritems(expected):
if k in actual: if k in actual:
if (isinstance(v, six.string_types) or if (isinstance(v, six.string_types) or
@ -134,7 +137,6 @@ class AmuletUtils(object):
def validate_relation_data(self, sentry_unit, relation, expected): def validate_relation_data(self, sentry_unit, relation, expected):
"""Validate actual relation data based on expected relation data.""" """Validate actual relation data based on expected relation data."""
actual = sentry_unit.relation(relation[0], relation[1]) actual = sentry_unit.relation(relation[0], relation[1])
self.log.debug('actual: {}'.format(repr(actual)))
return self._validate_dict_data(expected, actual) return self._validate_dict_data(expected, actual)
def _validate_list_data(self, expected, actual): def _validate_list_data(self, expected, actual):

View File

@ -44,7 +44,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
Determine if the local branch being tested is derived from its Determine if the local branch being tested is derived from its
stable or next (dev) branch, and based on this, use the corresonding stable or next (dev) branch, and based on this, use the corresonding
stable or next branches for the other_services.""" stable or next branches for the other_services."""
base_charms = ['mysql', 'mongodb', 'rabbitmq-server'] base_charms = ['mysql', 'mongodb']
if self.stable: if self.stable:
for svc in other_services: for svc in other_services: