Deal with drop of openswan in utopic
This commit is contained in:
parent
2cc8ced26e
commit
1665848c82
@ -1,7 +1,8 @@
|
||||
from charmhelpers.core.host import (
|
||||
service_running,
|
||||
service_stop,
|
||||
service_restart
|
||||
service_restart,
|
||||
lsb_release
|
||||
)
|
||||
from charmhelpers.core.hookenv import (
|
||||
log,
|
||||
@ -112,7 +113,6 @@ NEUTRON_GATEWAY_PKGS = {
|
||||
"nova-api-metadata",
|
||||
"neutron-plugin-metering-agent",
|
||||
"neutron-lbaas-agent",
|
||||
"openswan"
|
||||
],
|
||||
NVP: [
|
||||
"neutron-dhcp-agent",
|
||||
@ -148,10 +148,13 @@ def get_packages():
|
||||
plugin = remap_plugin(config('plugin'))
|
||||
packages = deepcopy(GATEWAY_PKGS[networking_name()][plugin])
|
||||
if (get_os_codename_install_source(config('openstack-origin'))
|
||||
>= 'icehouse' and plugin == 'ovs'):
|
||||
>= 'icehouse' and plugin == 'ovs'
|
||||
and lsb_release()['DISTRIB_CODENAME'] < 'utopic'):
|
||||
# NOTE(jamespage) neutron-vpn-agent supercedes l3-agent for icehouse
|
||||
# but openswan was removed in utopic.
|
||||
packages.remove('neutron-l3-agent')
|
||||
packages.append('neutron-vpn-agent')
|
||||
packages.append('openswan')
|
||||
return packages
|
||||
|
||||
|
||||
|
@ -43,6 +43,7 @@ TO_PATCH = [
|
||||
'service_restart',
|
||||
'remap_plugin',
|
||||
'is_relation_made',
|
||||
'lsb_release'
|
||||
]
|
||||
|
||||
|
||||
@ -62,6 +63,7 @@ class TestQuantumUtils(CharmTestCase):
|
||||
super(TestQuantumUtils, self).setUp(quantum_utils, TO_PATCH)
|
||||
self.networking_name.return_value = 'neutron'
|
||||
self.headers_package.return_value = 'linux-headers-2.6.18'
|
||||
self._set_distrib_codename('trusty')
|
||||
|
||||
def noop(value):
|
||||
return value
|
||||
@ -71,6 +73,9 @@ class TestQuantumUtils(CharmTestCase):
|
||||
# Reset cached cache
|
||||
hookenv.cache = {}
|
||||
|
||||
def _set_distrib_codename(self, newcodename):
|
||||
self.lsb_release.return_value = {'DISTRIB_CODENAME': newcodename}
|
||||
|
||||
def test_valid_plugin(self):
|
||||
self.config.return_value = 'ovs'
|
||||
self.assertTrue(quantum_utils.valid_plugin())
|
||||
@ -113,6 +118,19 @@ class TestQuantumUtils(CharmTestCase):
|
||||
self.assertTrue('neutron-vpn-agent' in quantum_utils.get_packages())
|
||||
self.assertFalse('neutron-l3-agent' in quantum_utils.get_packages())
|
||||
|
||||
def test_get_packages_ovs_juno_utopic(self):
|
||||
self.config.return_value = 'ovs'
|
||||
self.get_os_codename_install_source.return_value = 'juno'
|
||||
self._set_distrib_codename('utopic')
|
||||
self.assertFalse('neutron-vpn-agent' in quantum_utils.get_packages())
|
||||
self.assertTrue('neutron-l3-agent' in quantum_utils.get_packages())
|
||||
|
||||
def test_get_packages_ovs_juno_trusty(self):
|
||||
self.config.return_value = 'ovs'
|
||||
self.get_os_codename_install_source.return_value = 'juno'
|
||||
self.assertTrue('neutron-vpn-agent' in quantum_utils.get_packages())
|
||||
self.assertFalse('neutron-l3-agent' in quantum_utils.get_packages())
|
||||
|
||||
def test_configure_ovs_starts_service_if_required(self):
|
||||
self.config.return_value = 'ovs'
|
||||
self.service_running.return_value = False
|
||||
|
Loading…
Reference in New Issue
Block a user