예제 #1
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')
 def test_get_common_package_neutron(self):
     self.get_os_codename_package.return_value = None
     self.assertEquals(quantum_utils.get_common_package(), 'neutron-common')
 def test_get_common_package_quantum(self):
     self.get_os_codename_package.return_value = 'folsom'
     self.assertEquals(quantum_utils.get_common_package(), 'quantum-common')