コード例 #1
0
def register_configs():
    ''' Register config files with their respective contexts. '''
    release = get_os_codename_install_source(config('openstack-origin'))
    configs = templating.OSConfigRenderer(templates_dir=TEMPLATES,
                                          openstack_release=release)

    plugin = remap_plugin(config('plugin'))
    name = networking_name()
    if plugin == 'ovs':
        # NOTE: deal with switch to ML2 plugin for >= icehouse
        drop_config = NEUTRON_ML2_PLUGIN_CONF
        if release >= 'icehouse':
            drop_config = NEUTRON_OVS_PLUGIN_CONF
        if drop_config in CONFIG_FILES[name][plugin]:
            CONFIG_FILES[name][plugin].pop(drop_config)

    if is_relation_made('amqp-nova'):
        amqp_nova_ctxt = context.AMQPContext(
            ssl_dir=NOVA_CONF_DIR,
            rel_name='amqp-nova',
            relation_prefix='nova')
    else:
        amqp_nova_ctxt = context.AMQPContext(
            ssl_dir=NOVA_CONF_DIR,
            rel_name='amqp')
    CONFIG_FILES[name][plugin][NOVA_CONF][
        'hook_contexts'].append(amqp_nova_ctxt)
    for conf in CONFIG_FILES[name][plugin]:
        configs.register(conf,
                         CONFIG_FILES[name][plugin][conf]['hook_contexts'])
    return configs
コード例 #2
0
ファイル: neutron_utils.py プロジェクト: cloudbase/hyper-c
def get_packages():
    """Return a list of packages for install based on the configured plugin"""
    plugin = remap_plugin(config("plugin"))
    packages = deepcopy(GATEWAY_PKGS[networking_name()][plugin])
    source = get_os_codename_install_source(config("openstack-origin"))
    if plugin == "ovs":
        if source >= "icehouse" 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")
        if source >= "kilo":
            packages.append("python-neutron-fwaas")
        if source >= "liberty":
            # Switch out mysql driver
            packages.remove("python-mysqldb")
            packages.append("python-pymysql")
            # Switch out to actual metering agent package
            packages.remove("neutron-plugin-metering-agent")
            packages.append("neutron-metering-agent")
    packages.extend(determine_l3ha_packages())

    if git_install_requested():
        packages = list(set(packages))
        packages.extend(BASE_GIT_PACKAGES)
        # don't include packages that will be installed from git
        for p in GIT_PACKAGE_BLACKLIST:
            if p in packages:
                packages.remove(p)

    return packages
コード例 #3
0
def get_packages():
    '''Return a list of packages for install based on the configured plugin'''
    plugin = remap_plugin(config('plugin'))
    packages = deepcopy(GATEWAY_PKGS[networking_name()][plugin])
    source = get_os_codename_install_source(config('openstack-origin'))
    if plugin == 'ovs':
        if (source >= 'icehouse' 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')
        if source >= 'kilo':
            packages.append('python-neutron-fwaas')
        if source >= 'liberty':
            # Switch out mysql driver
            packages.remove('python-mysqldb')
            packages.append('python-pymysql')
            # Switch out to actual metering agent package
            packages.remove('neutron-plugin-metering-agent')
            packages.append('neutron-metering-agent')
    packages.extend(determine_l3ha_packages())

    if git_install_requested():
        packages = list(set(packages))
        packages.extend(BASE_GIT_PACKAGES)
        # don't include packages that will be installed from git
        for p in GIT_PACKAGE_BLACKLIST:
            if p in packages:
                packages.remove(p)

    return packages
コード例 #4
0
ファイル: neutron_utils.py プロジェクト: cloudbase/hyper-c
def register_configs():
    """ Register config files with their respective contexts. """
    release = get_os_codename_install_source(config("openstack-origin"))
    configs = templating.OSConfigRenderer(templates_dir=TEMPLATES, openstack_release=release)

    plugin = remap_plugin(config("plugin"))
    name = networking_name()
    if plugin == "ovs":
        # NOTE: deal with switch to ML2 plugin for >= icehouse
        drop_config = NEUTRON_ML2_PLUGIN_CONF
        if release >= "icehouse":
            drop_config = NEUTRON_OVS_PLUGIN_CONF
        if drop_config in CONFIG_FILES[name][plugin]:
            CONFIG_FILES[name][plugin].pop(drop_config)

    if is_relation_made("amqp-nova"):
        amqp_nova_ctxt = context.AMQPContext(ssl_dir=NOVA_CONF_DIR, rel_name="amqp-nova", relation_prefix="nova")
    else:
        amqp_nova_ctxt = context.AMQPContext(ssl_dir=NOVA_CONF_DIR, rel_name="amqp")
    CONFIG_FILES[name][plugin][NOVA_CONF]["hook_contexts"].append(amqp_nova_ctxt)
    for conf in CONFIG_FILES[name][plugin]:
        configs.register(conf, CONFIG_FILES[name][plugin][conf]["hook_contexts"])
    return configs
コード例 #5
0
 def test_remap_plugin_noop(self):
     self.get_os_codename_install_source.return_value = 'icehouse'
     self.assertEquals(neutron_contexts.remap_plugin('ovs'), 'ovs')
コード例 #6
0
 def test_remap_plugin(self):
     self.get_os_codename_install_source.return_value = 'havana'
     self.assertEquals(neutron_contexts.remap_plugin('nvp'), 'nvp')
     self.assertEquals(neutron_contexts.remap_plugin('nsx'), 'nvp')
コード例 #7
0
 def test_remap_plugin_noop(self):
     self.get_os_codename_install_source.return_value = 'icehouse'
     self.assertEquals(neutron_contexts.remap_plugin('ovs'), 'ovs')
コード例 #8
0
 def test_remap_plugin(self):
     self.get_os_codename_install_source.return_value = 'havana'
     self.assertEquals(neutron_contexts.remap_plugin('nvp'), 'nvp')
     self.assertEquals(neutron_contexts.remap_plugin('nsx'), 'nvp')