Ejemplo n.º 1
0
 def test_configure_ovs_ovs_ext_port(self):
     self.config.side_effect = self.test_config.get
     self.test_config.set('plugin', 'ovs')
     self.test_config.set('ext-port', 'eth0')
     quantum_utils.configure_ovs()
     self.add_bridge.assert_has_calls([
         call('br-int'),
         call('br-ex')
     ])
     self.add_bridge_port.assert_called_with('br-ex', 'eth0')
Ejemplo n.º 2
0
def config_changed():
    if openstack_upgrade_available(get_common_package()):
        do_openstack_upgrade(CONFIGS)
    if valid_plugin():
        CONFIGS.write_all()
        configure_ovs()
    else:
        log('Please provide a valid plugin config', level=ERROR)
        sys.exit(1)
    if config('plugin') == 'n1kv':
        if config('l3-agent') == 'enable':
            if not service_running('neutron-l3-agent'):
                service_start('neutron-l3-agent')
        else:
            if service_running('neutron-l3-agent'):
                service_stop('neutron-l3-agent')
Ejemplo n.º 3
0
 def test_configure_ovs_doesnt_restart_service(self):
     self.service_running.return_value = True
     quantum_utils.configure_ovs()
     self.assertFalse(self.full_restart.called)
Ejemplo n.º 4
0
 def test_configure_ovs_starts_service_if_required(self):
     self.config.return_value = 'ovs'
     self.service_running.return_value = False
     quantum_utils.configure_ovs()
     self.assertTrue(self.full_restart.called)