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