synrax cleanup, changed relation naming, other fixes
This commit is contained in:
parent
a55c2425f5
commit
c14ce31355
@ -3,10 +3,6 @@ options:
|
||||
default: '2017.2.2'
|
||||
type: string
|
||||
description: Arista Driver version
|
||||
pip-proxy:
|
||||
type: string
|
||||
default: None
|
||||
description: Proxy address to install python modules behind a proxy.
|
||||
eapi-host:
|
||||
default:
|
||||
type: string
|
||||
|
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
import subprocess
|
||||
|
||||
from collections import OrderedDict
|
||||
|
||||
import charmhelpers.core.hookenv as hookenv
|
||||
from charmhelpers.core.hookenv import (
|
||||
config,
|
||||
@ -14,13 +16,16 @@ import charms_openstack.charm
|
||||
|
||||
from charmhelpers.contrib.python.packages import pip_install
|
||||
|
||||
from charmhelpers.contrib.openstack import context
|
||||
from charmhelpers.contrib.openstack import (
|
||||
context,
|
||||
templating,
|
||||
)
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
CompareOpenStackReleases,
|
||||
os_release,
|
||||
)
|
||||
|
||||
ML2_CONFIG_ARISTA = '/etc/neutron/plugins/ml2/ml2_conf_arista.ini'
|
||||
ML2_CONFIG = '/etc/neutron/plugins/ml2/ml2_conf_arista.ini'
|
||||
TEMPLATES = 'templates/'
|
||||
|
||||
|
||||
@ -38,11 +43,7 @@ class NeutronAristaCharm(charms_openstack.charm.OpenStackCharm):
|
||||
def install(self):
|
||||
package_version = config('arista-version')
|
||||
package_name = 'networking-arista==%s' % package_version
|
||||
proxy = config('pip-proxy')
|
||||
if proxy:
|
||||
pip_install(package_name, fatal=True, proxy=proxy)
|
||||
else:
|
||||
pip_install(package_name, fatal=True)
|
||||
pip_install(package_name, fatal=True)
|
||||
status_set('active', 'Unit is ready')
|
||||
|
||||
|
||||
@ -64,14 +65,10 @@ def register_configs(release=None):
|
||||
'services': ['neutron-server'],
|
||||
'contexts': [AristaMl2Context(), ]
|
||||
}),
|
||||
(ML2_CONFIG_ARISTA, {
|
||||
'services': ['neutron-server'],
|
||||
'contexts': [AristaMl2Context(), ]
|
||||
}),
|
||||
])
|
||||
release = os_release('neutron-common')
|
||||
configs = templating.OSConfigRenderer(templates_dir=TEMPLATES,
|
||||
openstack_release=release)
|
||||
for cfg, rscs in resources.iteritems():
|
||||
for cfg, rscs in resources.items():
|
||||
configs.register(cfg, rscs['contexts'])
|
||||
return configs
|
||||
|
@ -10,7 +10,7 @@ subordinate: true
|
||||
series:
|
||||
- xenial
|
||||
provides:
|
||||
neutron-arista:
|
||||
neutron-plugin-api-subordinate:
|
||||
interface: neutron-plugin-api-subordinate
|
||||
scope: container
|
||||
requires:
|
||||
|
@ -18,7 +18,9 @@ from charms_openstack.charm import (
|
||||
provide_charm_instance,
|
||||
use_defaults,
|
||||
)
|
||||
import charm.openstack.keystone_ico as ico # noqa
|
||||
import charm.openstack.neutron_arista as arista # noqa
|
||||
|
||||
from charm.openstack.neutron_arista import register_configs
|
||||
|
||||
CONFIGS = register_configs()
|
||||
|
||||
@ -35,8 +37,6 @@ def install_neutron_arista():
|
||||
@reactive.when('neutron-plugin-api-subordinate.connected')
|
||||
@reactive.when('neutron-arista.installed')
|
||||
def configure_principle(api_principle):
|
||||
with provide_charm_instance() as charm_class:
|
||||
charm_class.render_ml2_conf()
|
||||
injet_config = {
|
||||
'neutron-api': {
|
||||
'/etc/neutron/neutron.conf': {
|
||||
@ -47,6 +47,7 @@ def configure_principle(api_principle):
|
||||
}
|
||||
}
|
||||
}
|
||||
CONFIGS.write_all()
|
||||
api_principle.configure_plugin(
|
||||
neutron_plugin='arista',
|
||||
core_plugin='neutron.plugins.ml2.plugin.Ml2Plugin',
|
||||
|
Loading…
x
Reference in New Issue
Block a user