update for nvp support

This commit is contained in:
James Page 2013-10-22 15:01:55 -07:00
parent 812a18652b
commit 4d891fd2b7
2 changed files with 5 additions and 12 deletions

View File

@ -80,7 +80,6 @@ NEUTRON_GATEWAY_PKGS = {
"nova-api-metadata" "nova-api-metadata"
], ],
NVP: [ NVP: [
"openvswitch-switch",
"neutron-dhcp-agent", "neutron-dhcp-agent",
'python-mysqldb', 'python-mysqldb',
'python-oslo.config', # Force upgrade 'python-oslo.config', # Force upgrade
@ -95,7 +94,7 @@ GATEWAY_PKGS = {
EARLY_PACKAGES = { EARLY_PACKAGES = {
OVS: ['openvswitch-datapath-dkms'], OVS: ['openvswitch-datapath-dkms'],
NVP: ['openvswitch-datapath-dkms'] NVP: []
} }
@ -396,13 +395,11 @@ def do_openstack_upgrade(configs):
def configure_ovs(): def configure_ovs():
if config('plugin') == OVS:
if not service_running('openvswitch-switch'): if not service_running('openvswitch-switch'):
full_restart() full_restart()
if config('plugin') == OVS:
add_bridge(INT_BRIDGE) add_bridge(INT_BRIDGE)
add_bridge(EXT_BRIDGE) add_bridge(EXT_BRIDGE)
ext_port = config('ext-port') ext_port = config('ext-port')
if ext_port: if ext_port:
add_bridge_port(EXT_BRIDGE, ext_port) add_bridge_port(EXT_BRIDGE, ext_port)
if config('plugin') == NVP:
add_bridge(INT_BRIDGE)

View File

@ -60,7 +60,7 @@ class TestQuantumUtils(CharmTestCase):
self.config.return_value = 'nvp' self.config.return_value = 'nvp'
self.assertEquals( self.assertEquals(
quantum_utils.get_early_packages(), quantum_utils.get_early_packages(),
['openvswitch-datapath-dkms', 'linux-headers-2.6.18']) [])
@patch.object(quantum_utils, 'EARLY_PACKAGES') @patch.object(quantum_utils, 'EARLY_PACKAGES')
def test_get_early_packages_no_dkms(self, _early_packages): def test_get_early_packages_no_dkms(self, _early_packages):
@ -76,6 +76,7 @@ class TestQuantumUtils(CharmTestCase):
self.assertNotEqual(quantum_utils.get_packages(), []) self.assertNotEqual(quantum_utils.get_packages(), [])
def test_configure_ovs_starts_service_if_required(self): def test_configure_ovs_starts_service_if_required(self):
self.config.return_value = 'ovs'
self.service_running.return_value = False self.service_running.return_value = False
quantum_utils.configure_ovs() quantum_utils.configure_ovs()
self.assertTrue(self.full_restart.called) self.assertTrue(self.full_restart.called)
@ -96,11 +97,6 @@ class TestQuantumUtils(CharmTestCase):
]) ])
self.add_bridge_port.assert_called_with('br-ex', 'eth0') self.add_bridge_port.assert_called_with('br-ex', 'eth0')
def test_configure_ovs_nvp(self):
self.config.return_value = 'nvp'
quantum_utils.configure_ovs()
self.add_bridge.assert_called_with('br-int')
def test_do_openstack_upgrade(self): def test_do_openstack_upgrade(self):
self.config.side_effect = self.test_config.get self.config.side_effect = self.test_config.get
self.test_config.set('openstack-origin', 'cloud:precise-havana') self.test_config.set('openstack-origin', 'cloud:precise-havana')