Changes: (#1)

- Added support for deb networking-plumgrid install
 - plumlib.ini changes

Signed-off-by: plumgrid <Junaid Ali>
This commit is contained in:
Junaid Ali 2016-08-20 05:26:09 +05:00 committed by GitHub
parent 4c4cd9c000
commit cc691a5319
5 changed files with 44 additions and 12 deletions

View File

@ -57,3 +57,17 @@ options:
type: string type: string
default: Default default: Default
description: Keystone project domain name description: Keystone project domain name
enable-deb-networking-install:
type: boolean
default: False
description: |
If enabled networking plumgrid is installed from deb package on LCM instead of
installation using pip
enable-flow-tap:
type: boolean
default: True
description: Toggles reverse flow creation for tap based policies
enable-metaconfig:
type: boolean
default: True
description: Enables/disables nova communication for metaconfig

View File

@ -120,6 +120,8 @@ class NeutronPGPluginContext(context.NeutronContext):
pg_ctxt['connector_type'] = config('connector-type') pg_ctxt['connector_type'] = config('connector-type')
pg_ctxt['user_domain_name'] = config('user-domain-name') pg_ctxt['user_domain_name'] = config('user-domain-name')
pg_ctxt['project_domain_name'] = config('project-domain-name') pg_ctxt['project_domain_name'] = config('project-domain-name')
pg_ctxt['enable_reverse_flow_tap'] = config('enable-flow-tap')
pg_ctxt['nova_metaconfig'] = config('enable-metaconfig')
if enable_metadata: if enable_metadata:
plumgrid_edge_ctxt = _edge_context() plumgrid_edge_ctxt = _edge_context()
pg_ctxt['nova_metadata_proxy_secret'] = \ pg_ctxt['nova_metadata_proxy_secret'] = \

View File

@ -12,6 +12,7 @@ from charmhelpers.contrib.openstack import templating
from charmhelpers.contrib.openstack.neutron import neutron_plugin_attribute from charmhelpers.contrib.openstack.neutron import neutron_plugin_attribute
from charmhelpers.contrib.python.packages import pip_install from charmhelpers.contrib.python.packages import pip_install
from charmhelpers.fetch import ( from charmhelpers.fetch import (
apt_install,
apt_cache apt_cache
) )
from charmhelpers.core.hookenv import ( from charmhelpers.core.hookenv import (
@ -166,6 +167,7 @@ def install_networking_plumgrid():
''' '''
Installs networking-plumgrid package Installs networking-plumgrid package
''' '''
if not config('enable-deb-networking-install'):
release = os_release('neutron-common', base='kilo') release = os_release('neutron-common', base='kilo')
if config('networking-plumgrid-version') is None: if config('networking-plumgrid-version') is None:
package_version = NETWORKING_PLUMGRID_VERSION[release] package_version = NETWORKING_PLUMGRID_VERSION[release]
@ -178,6 +180,10 @@ def install_networking_plumgrid():
pip_install(package_name, fatal=True) pip_install(package_name, fatal=True)
if is_leader() and package_version != '2015.1.1.1': if is_leader() and package_version != '2015.1.1.1':
migrate_neutron_db() migrate_neutron_db()
else:
apt_install('networking-plumgrid', options=['--force-yes'], fatal=True)
if is_leader():
migrate_neutron_db()
def migrate_neutron_db(): def migrate_neutron_db():

View File

@ -14,9 +14,15 @@ enable_pg_security = True
# Reverse Flow Flag # Reverse Flow Flag
enable_reverse_flow = True enable_reverse_flow = True
# Reverse Flow Flag Tap
enable_reverse_flow_tap = {{ enable_reverse_flow_tap }}
# Flag to enable/disable virtual appliance creation # Flag to enable/disable virtual appliance creation
vapp_flag = False vapp_flag = False
# Flag to enable/disable nova communication for metaconfig
nova_metaconfig = {{ nova_metaconfig }}
# Metadata Flags. If "metadata_ns" is set to false, respective # Metadata Flags. If "metadata_ns" is set to false, respective
# namespace for metadata won't be created on this node # namespace for metadata won't be created on this node
[PLUMgridMetadata] [PLUMgridMetadata]

View File

@ -61,7 +61,9 @@ class NeutronPGContextTest(CharmTestCase):
'switch-password': 'plumgrid', 'switch-password': 'plumgrid',
'connector-type': 'service', 'connector-type': 'service',
'user-domain-name': 'Default', 'user-domain-name': 'Default',
'project-domain-name': 'Default' 'project-domain-name': 'Default',
'enable-flow-tap': 'True',
'enable-metaconfig': 'True',
} }
def mock_config(key=None): def mock_config(key=None):
@ -98,5 +100,7 @@ class NeutronPGContextTest(CharmTestCase):
'pg_metadata_ip': '169.254.169.254', 'pg_metadata_ip': '169.254.169.254',
'pg_metadata_subnet': '169.254.169.254/30', 'pg_metadata_subnet': '169.254.169.254/30',
'pg_metadata_port': '8775', 'pg_metadata_port': '8775',
'enable_reverse_flow_tap': 'True',
'nova_metaconfig': 'True',
} }
self.assertEquals(expect, napi_ctxt()) self.assertEquals(expect, napi_ctxt())