예제 #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')
예제 #2
0
def install():
    execd_preinstall()
    src = config('openstack-origin')
    if (lsb_release()['DISTRIB_CODENAME'] == 'precise' and
            src == 'distro'):
        src = 'cloud:precise-folsom'
    configure_installation_source(src)
    apt_update(fatal=True)
    if valid_plugin():
        apt_install(filter_installed_packages(get_early_packages()),
                    fatal=True)
        apt_install(filter_installed_packages(get_packages()),
                    fatal=True)
    else:
        log('Please provide a valid plugin config', level=ERROR)
        sys.exit(1)
 def test_invalid_plugin(self):
     self.config.return_value = 'invalid'
     self.assertFalse(quantum_utils.valid_plugin())
 def test_valid_plugin(self):
     self.config.return_value = 'ovs'
     self.assertTrue(quantum_utils.valid_plugin())
     self.config.return_value = 'nvp'
     self.assertTrue(quantum_utils.valid_plugin())