Support added for metadata
This commit is contained in:
parent
e625d03935
commit
1dfdd5098a
|
@ -11,7 +11,6 @@ Step by step instructions on using the charm:
|
||||||
juju deploy plumgrid-director
|
juju deploy plumgrid-director
|
||||||
|
|
||||||
juju add-relation neutron-api neutron-api-plumgrid
|
juju add-relation neutron-api neutron-api-plumgrid
|
||||||
juju add-relation neutron-api-plumgrid plumgrid-director
|
|
||||||
|
|
||||||
For plumgrid-director to work make the configuration in the neutron-api and neutron-api-plumgrid charms as specified in the configuration section below.
|
For plumgrid-director to work make the configuration in the neutron-api and neutron-api-plumgrid charms as specified in the configuration section below.
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ Example Config
|
||||||
neutron-api-plumgrid:
|
neutron-api-plumgrid:
|
||||||
install_sources: 'ppa:plumgrid-team/stable'
|
install_sources: 'ppa:plumgrid-team/stable'
|
||||||
install_keys: 'null'
|
install_keys: 'null'
|
||||||
enable-metadata: False
|
enable-metadata: True
|
||||||
neutron-api:
|
neutron-api:
|
||||||
neutron-plugin: "plumgrid"
|
neutron-plugin: "plumgrid"
|
||||||
plumgrid-virtual-ip: "192.168.100.250"
|
plumgrid-virtual-ip: "192.168.100.250"
|
||||||
|
|
|
@ -50,19 +50,6 @@ def install():
|
||||||
add_lcm_key()
|
add_lcm_key()
|
||||||
|
|
||||||
|
|
||||||
@hooks.hook('plumgrid-plugin-relation-joined')
|
|
||||||
def plumgrid_dir():
|
|
||||||
'''
|
|
||||||
This hook is run when relation between neutron-api-plumgrid
|
|
||||||
and plumgrid-director is made.
|
|
||||||
'''
|
|
||||||
ensure_mtu()
|
|
||||||
ensure_files()
|
|
||||||
add_lcm_key()
|
|
||||||
CONFIGS.write_all()
|
|
||||||
restart_pg()
|
|
||||||
|
|
||||||
|
|
||||||
@hooks.hook('config-changed')
|
@hooks.hook('config-changed')
|
||||||
def config_changed():
|
def config_changed():
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
pg_dir_hooks.py
|
|
|
@ -1 +0,0 @@
|
||||||
pg_dir_hooks.py
|
|
|
@ -1 +0,0 @@
|
||||||
pg_dir_hooks.py
|
|
|
@ -52,8 +52,7 @@ class PGDirHooksTests(CharmTestCase):
|
||||||
self.configure_sources.assert_called_with(update=True)
|
self.configure_sources.assert_called_with(update=True)
|
||||||
self.apt_install.assert_has_calls([
|
self.apt_install.assert_has_calls([
|
||||||
call(_pkgs, fatal=True,
|
call(_pkgs, fatal=True,
|
||||||
options=['--force-yes',
|
options=['--force-yes']),
|
||||||
'--option=Dpkg::Options::=--force-confold']),
|
|
||||||
])
|
])
|
||||||
self.load_iovisor.assert_called_with()
|
self.load_iovisor.assert_called_with()
|
||||||
self.ensure_mtu.assert_called_with()
|
self.ensure_mtu.assert_called_with()
|
||||||
|
@ -68,8 +67,7 @@ class PGDirHooksTests(CharmTestCase):
|
||||||
self.configure_sources.assert_called_with(update=True)
|
self.configure_sources.assert_called_with(update=True)
|
||||||
self.apt_install.assert_has_calls([
|
self.apt_install.assert_has_calls([
|
||||||
call(_pkgs, fatal=True,
|
call(_pkgs, fatal=True,
|
||||||
options=['--force-yes',
|
options=['--force-yes']),
|
||||||
'--option=Dpkg::Options::=--force-confold']),
|
|
||||||
])
|
])
|
||||||
self.load_iovisor.assert_called_with()
|
self.load_iovisor.assert_called_with()
|
||||||
self.ensure_mtu.assert_called_with()
|
self.ensure_mtu.assert_called_with()
|
||||||
|
@ -78,13 +76,6 @@ class PGDirHooksTests(CharmTestCase):
|
||||||
self.CONFIGS.write_all.assert_called_with()
|
self.CONFIGS.write_all.assert_called_with()
|
||||||
self.restart_pg.assert_called_with()
|
self.restart_pg.assert_called_with()
|
||||||
|
|
||||||
def test_neutron_joined(self):
|
|
||||||
self._call_hook('plumgrid-plugin-relation-joined')
|
|
||||||
self.ensure_mtu.assert_called_with()
|
|
||||||
self.ensure_files.assert_called_with()
|
|
||||||
self.add_lcm_key.assert_called_with()
|
|
||||||
self.CONFIGS.write_all.assert_called_with()
|
|
||||||
self.restart_pg.assert_called_with()
|
|
||||||
|
|
||||||
def test_stop(self):
|
def test_stop(self):
|
||||||
_pkgs = ['plumgrid-lxc', 'iovisor-dkms']
|
_pkgs = ['plumgrid-lxc', 'iovisor-dkms']
|
||||||
|
|
|
@ -50,9 +50,9 @@ class TestPGDirUtils(CharmTestCase):
|
||||||
self.os_release.return_value = 'trusty'
|
self.os_release.return_value = 'trusty'
|
||||||
templating.OSConfigRenderer.side_effect = _mock_OSConfigRenderer
|
templating.OSConfigRenderer.side_effect = _mock_OSConfigRenderer
|
||||||
_regconfs = nutils.register_configs()
|
_regconfs = nutils.register_configs()
|
||||||
confs = ['/var/lib/libvirt/filesystems/plumgrid/etc/keepalived/keepalived.conf',
|
confs = ['/var/lib/libvirt/filesystems/plumgrid-data/conf/etc/keepalived.conf',
|
||||||
'/var/lib/libvirt/filesystems/plumgrid/opt/pg/etc/plumgrid.conf',
|
'/var/lib/libvirt/filesystems/plumgrid-data/conf/pg/plumgrid.conf',
|
||||||
'/var/lib/libvirt/filesystems/plumgrid/opt/pg/sal/nginx/conf.d/default.conf',
|
'/var/lib/libvirt/filesystems/plumgrid-data/conf/pg/nginx.conf',
|
||||||
'/var/lib/libvirt/filesystems/plumgrid-data/conf/etc/hostname',
|
'/var/lib/libvirt/filesystems/plumgrid-data/conf/etc/hostname',
|
||||||
'/var/lib/libvirt/filesystems/plumgrid-data/conf/etc/hosts',
|
'/var/lib/libvirt/filesystems/plumgrid-data/conf/etc/hosts',
|
||||||
'/var/lib/libvirt/filesystems/plumgrid-data/conf/pg/ifcs.conf']
|
'/var/lib/libvirt/filesystems/plumgrid-data/conf/pg/ifcs.conf']
|
||||||
|
@ -61,20 +61,20 @@ class TestPGDirUtils(CharmTestCase):
|
||||||
def test_resource_map(self):
|
def test_resource_map(self):
|
||||||
_map = nutils.resource_map()
|
_map = nutils.resource_map()
|
||||||
svcs = ['plumgrid']
|
svcs = ['plumgrid']
|
||||||
confs = [nutils.PGKA_CONF]
|
confs = [nutils.PG_KA_CONF]
|
||||||
[self.assertIn(q_conf, _map.keys()) for q_conf in confs]
|
[self.assertIn(q_conf, _map.keys()) for q_conf in confs]
|
||||||
self.assertEqual(_map[nutils.PGKA_CONF]['services'], svcs)
|
self.assertEqual(_map[nutils.PG_KA_CONF]['services'], svcs)
|
||||||
|
|
||||||
def test_restart_map(self):
|
def test_restart_map(self):
|
||||||
_restart_map = nutils.restart_map()
|
_restart_map = nutils.restart_map()
|
||||||
PGKA_CONF = '/var/lib/libvirt/filesystems/plumgrid/etc/keepalived/keepalived.conf'
|
PG_KA_CONF = '/var/lib/libvirt/filesystems/plumgrid-data/conf/etc/keepalived.conf'
|
||||||
expect = OrderedDict([
|
expect = OrderedDict([
|
||||||
(nutils.PG_CONF, ['plumgrid']),
|
(nutils.PG_CONF, ['plumgrid']),
|
||||||
(PGKA_CONF, ['plumgrid']),
|
(PG_KA_CONF, ['plumgrid']),
|
||||||
(nutils.PGDEF_CONF, ['plumgrid']),
|
(nutils.PG_DEF_CONF, ['plumgrid']),
|
||||||
(nutils.PGHN_CONF, ['plumgrid']),
|
(nutils.PG_HN_CONF, ['plumgrid']),
|
||||||
(nutils.PGHS_CONF, ['plumgrid']),
|
(nutils.PG_HS_CONF, ['plumgrid']),
|
||||||
(nutils.PGIFCS_CONF, []),
|
(nutils.PG_IFCS_CONF, []),
|
||||||
])
|
])
|
||||||
self.assertEqual(expect, _restart_map)
|
self.assertEqual(expect, _restart_map)
|
||||||
for item in _restart_map:
|
for item in _restart_map:
|
||||||
|
|
Loading…
Reference in New Issue