Resync charms
This commit is contained in:
parent
ee17bcd123
commit
ae383fba6a
|
@ -752,7 +752,7 @@ class OpenStackAmuletUtils(AmuletUtils):
|
||||||
self.log.debug('SSL is enabled @{}:{} '
|
self.log.debug('SSL is enabled @{}:{} '
|
||||||
'({})'.format(host, port, unit_name))
|
'({})'.format(host, port, unit_name))
|
||||||
return True
|
return True
|
||||||
elif not port and not conf_ssl:
|
elif not conf_ssl:
|
||||||
self.log.debug('SSL not enabled @{}:{} '
|
self.log.debug('SSL not enabled @{}:{} '
|
||||||
'({})'.format(host, port, unit_name))
|
'({})'.format(host, port, unit_name))
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
|
# along with charm-helpers. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import glob
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -951,6 +952,19 @@ class NeutronContext(OSContextGenerator):
|
||||||
'config': config}
|
'config': config}
|
||||||
return ovs_ctxt
|
return ovs_ctxt
|
||||||
|
|
||||||
|
def midonet_ctxt(self):
|
||||||
|
driver = neutron_plugin_attribute(self.plugin, 'driver',
|
||||||
|
self.network_manager)
|
||||||
|
midonet_config = neutron_plugin_attribute(self.plugin, 'config',
|
||||||
|
self.network_manager)
|
||||||
|
mido_ctxt = {'core_plugin': driver,
|
||||||
|
'neutron_plugin': 'midonet',
|
||||||
|
'neutron_security_groups': self.neutron_security_groups,
|
||||||
|
'local_ip': unit_private_ip(),
|
||||||
|
'config': midonet_config}
|
||||||
|
|
||||||
|
return mido_ctxt
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
if self.network_manager not in ['quantum', 'neutron']:
|
if self.network_manager not in ['quantum', 'neutron']:
|
||||||
return {}
|
return {}
|
||||||
|
@ -972,6 +986,8 @@ class NeutronContext(OSContextGenerator):
|
||||||
ctxt.update(self.nuage_ctxt())
|
ctxt.update(self.nuage_ctxt())
|
||||||
elif self.plugin == 'plumgrid':
|
elif self.plugin == 'plumgrid':
|
||||||
ctxt.update(self.pg_ctxt())
|
ctxt.update(self.pg_ctxt())
|
||||||
|
elif self.plugin == 'midonet':
|
||||||
|
ctxt.update(self.midonet_ctxt())
|
||||||
|
|
||||||
alchemy_flags = config('neutron-alchemy-flags')
|
alchemy_flags = config('neutron-alchemy-flags')
|
||||||
if alchemy_flags:
|
if alchemy_flags:
|
||||||
|
@ -1104,7 +1120,7 @@ class SubordinateConfigContext(OSContextGenerator):
|
||||||
|
|
||||||
ctxt = {
|
ctxt = {
|
||||||
... other context ...
|
... other context ...
|
||||||
'subordinate_config': {
|
'subordinate_configuration': {
|
||||||
'DEFAULT': {
|
'DEFAULT': {
|
||||||
'key1': 'value1',
|
'key1': 'value1',
|
||||||
},
|
},
|
||||||
|
@ -1145,22 +1161,23 @@ class SubordinateConfigContext(OSContextGenerator):
|
||||||
try:
|
try:
|
||||||
sub_config = json.loads(sub_config)
|
sub_config = json.loads(sub_config)
|
||||||
except:
|
except:
|
||||||
log('Could not parse JSON from subordinate_config '
|
log('Could not parse JSON from '
|
||||||
'setting from %s' % rid, level=ERROR)
|
'subordinate_configuration setting from %s'
|
||||||
|
% rid, level=ERROR)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for service in self.services:
|
for service in self.services:
|
||||||
if service not in sub_config:
|
if service not in sub_config:
|
||||||
log('Found subordinate_config on %s but it contained'
|
log('Found subordinate_configuration on %s but it '
|
||||||
'nothing for %s service' % (rid, service),
|
'contained nothing for %s service'
|
||||||
level=INFO)
|
% (rid, service), level=INFO)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
sub_config = sub_config[service]
|
sub_config = sub_config[service]
|
||||||
if self.config_file not in sub_config:
|
if self.config_file not in sub_config:
|
||||||
log('Found subordinate_config on %s but it contained'
|
log('Found subordinate_configuration on %s but it '
|
||||||
'nothing for %s' % (rid, self.config_file),
|
'contained nothing for %s'
|
||||||
level=INFO)
|
% (rid, self.config_file), level=INFO)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
sub_config = sub_config[self.config_file]
|
sub_config = sub_config[self.config_file]
|
||||||
|
@ -1363,7 +1380,7 @@ class DataPortContext(NeutronPortContext):
|
||||||
normalized.update({port: port for port in resolved
|
normalized.update({port: port for port in resolved
|
||||||
if port in ports})
|
if port in ports})
|
||||||
if resolved:
|
if resolved:
|
||||||
return {bridge: normalized[port] for port, bridge in
|
return {normalized[port]: bridge for port, bridge in
|
||||||
six.iteritems(portmap) if port in normalized.keys()}
|
six.iteritems(portmap) if port in normalized.keys()}
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
@ -1374,12 +1391,22 @@ class PhyNICMTUContext(DataPortContext):
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
ctxt = {}
|
ctxt = {}
|
||||||
mappings = super(PhyNICMTUContext, self).__call__()
|
mappings = super(PhyNICMTUContext, self).__call__()
|
||||||
if mappings and mappings.values():
|
if mappings and mappings.keys():
|
||||||
ports = mappings.values()
|
ports = sorted(mappings.keys())
|
||||||
napi_settings = NeutronAPIContext()()
|
napi_settings = NeutronAPIContext()()
|
||||||
mtu = napi_settings.get('network_device_mtu')
|
mtu = napi_settings.get('network_device_mtu')
|
||||||
|
all_ports = set()
|
||||||
|
# If any of ports is a vlan device, its underlying device must have
|
||||||
|
# mtu applied first.
|
||||||
|
for port in ports:
|
||||||
|
for lport in glob.glob("/sys/class/net/%s/lower_*" % port):
|
||||||
|
lport = os.path.basename(lport)
|
||||||
|
all_ports.add(lport.split('_')[1])
|
||||||
|
|
||||||
|
all_ports = list(all_ports)
|
||||||
|
all_ports.extend(ports)
|
||||||
if mtu:
|
if mtu:
|
||||||
ctxt["devs"] = '\\n'.join(ports)
|
ctxt["devs"] = '\\n'.join(all_ports)
|
||||||
ctxt['mtu'] = mtu
|
ctxt['mtu'] = mtu
|
||||||
|
|
||||||
return ctxt
|
return ctxt
|
||||||
|
|
|
@ -209,6 +209,20 @@ def neutron_plugins():
|
||||||
'server_packages': ['neutron-server',
|
'server_packages': ['neutron-server',
|
||||||
'neutron-plugin-plumgrid'],
|
'neutron-plugin-plumgrid'],
|
||||||
'server_services': ['neutron-server']
|
'server_services': ['neutron-server']
|
||||||
|
},
|
||||||
|
'midonet': {
|
||||||
|
'config': '/etc/neutron/plugins/midonet/midonet.ini',
|
||||||
|
'driver': 'midonet.neutron.plugin.MidonetPluginV2',
|
||||||
|
'contexts': [
|
||||||
|
context.SharedDBContext(user=config('neutron-database-user'),
|
||||||
|
database=config('neutron-database'),
|
||||||
|
relation_prefix='neutron',
|
||||||
|
ssl_dir=NEUTRON_CONF_DIR)],
|
||||||
|
'services': [],
|
||||||
|
'packages': [[headers_package()] + determine_dkms_package()],
|
||||||
|
'server_packages': ['neutron-server',
|
||||||
|
'python-neutron-plugin-midonet'],
|
||||||
|
'server_services': ['neutron-server']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if release >= 'icehouse':
|
if release >= 'icehouse':
|
||||||
|
@ -310,10 +324,10 @@ def parse_bridge_mappings(mappings):
|
||||||
def parse_data_port_mappings(mappings, default_bridge='br-data'):
|
def parse_data_port_mappings(mappings, default_bridge='br-data'):
|
||||||
"""Parse data port mappings.
|
"""Parse data port mappings.
|
||||||
|
|
||||||
Mappings must be a space-delimited list of port:bridge mappings.
|
Mappings must be a space-delimited list of bridge:port.
|
||||||
|
|
||||||
Returns dict of the form {port:bridge} where port may be an mac address or
|
Returns dict of the form {port:bridge} where ports may be mac addresses or
|
||||||
interface name.
|
interface names.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# NOTE(dosaboy): we use rvalue for key to allow multiple values to be
|
# NOTE(dosaboy): we use rvalue for key to allow multiple values to be
|
||||||
|
|
|
@ -13,3 +13,9 @@ log to syslog = {{ use_syslog }}
|
||||||
err to syslog = {{ use_syslog }}
|
err to syslog = {{ use_syslog }}
|
||||||
clog to syslog = {{ use_syslog }}
|
clog to syslog = {{ use_syslog }}
|
||||||
|
|
||||||
|
[client]
|
||||||
|
{% if rbd_client_cache_settings -%}
|
||||||
|
{% for key, value in rbd_client_cache_settings.iteritems() -%}
|
||||||
|
{{ key }} = {{ value }}
|
||||||
|
{% endfor -%}
|
||||||
|
{%- endif %}
|
|
@ -121,6 +121,7 @@ SWIFT_CODENAMES = OrderedDict([
|
||||||
('2.2.2', 'kilo'),
|
('2.2.2', 'kilo'),
|
||||||
('2.3.0', 'liberty'),
|
('2.3.0', 'liberty'),
|
||||||
('2.4.0', 'liberty'),
|
('2.4.0', 'liberty'),
|
||||||
|
('2.5.0', 'liberty'),
|
||||||
])
|
])
|
||||||
|
|
||||||
# >= Liberty version->codename mapping
|
# >= Liberty version->codename mapping
|
||||||
|
|
|
@ -752,7 +752,7 @@ class OpenStackAmuletUtils(AmuletUtils):
|
||||||
self.log.debug('SSL is enabled @{}:{} '
|
self.log.debug('SSL is enabled @{}:{} '
|
||||||
'({})'.format(host, port, unit_name))
|
'({})'.format(host, port, unit_name))
|
||||||
return True
|
return True
|
||||||
elif not port and not conf_ssl:
|
elif not conf_ssl:
|
||||||
self.log.debug('SSL not enabled @{}:{} '
|
self.log.debug('SSL not enabled @{}:{} '
|
||||||
'({})'.format(host, port, unit_name))
|
'({})'.format(host, port, unit_name))
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue