From a0dddcdf034ed3412bf525e752d584a759ed4513 Mon Sep 17 00:00:00 2001 From: sunny-verma Date: Sat, 16 Apr 2016 20:46:04 -0400 Subject: [PATCH] Added vsd-cms-id as part of config option. To cover the case when Nuage VSD & VSC are deployed outside of juju framework. Removed nuage-tarball from config file Removed respective code form neutron_api_hook.py Change-Id: I4518435ded9e1a4eb3d98cbb2e77f04b4f2dda61 Signed-off-by: sunny-verma --- config.yaml | 10 ++++++---- hooks/neutron_api_context.py | 2 +- hooks/neutron_api_hooks.py | 31 +++---------------------------- templates/kilo/nuage_plugin.ini | 2 +- 4 files changed, 11 insertions(+), 34 deletions(-) diff --git a/config.yaml b/config.yaml index 1ee788ee..6b476341 100755 --- a/config.yaml +++ b/config.yaml @@ -301,6 +301,12 @@ options: description: | Its [nuage-openstack-neutron nuagenetlib] for Nuage VSP >=3.2R4 & KILO and [nuage-neutron python-nuagenetlib] of Nuage VSP <=3.0 & JUNO + vsd-cms-id: + type: string + default: + description: | + CMS ID is used as an authentication token from VSD to CMS. + This value is being generated via nuage scripts and can be set pre/post deployment. vsd-cms-name: type: string default: @@ -337,10 +343,6 @@ options: type: string default: juju-enterprise description: Name of the Organization or Enterprise to create in Nuage VSD - nuage-tarball-url: - type: string - default: - description: Optional URL to tarball containing Nuage python packages. # end of Nuage VSD configuration l2-population: type: boolean diff --git a/hooks/neutron_api_context.py b/hooks/neutron_api_context.py index d085bb20..a7946832 100644 --- a/hooks/neutron_api_context.py +++ b/hooks/neutron_api_context.py @@ -197,7 +197,7 @@ class NeutronCCContext(context.NeutronContext): log('relation data:cms_id required for' ' nuage plugin: {}'.format(cms_id_value)) if cms_id_value is not None: - ctxt['cms_id'] = '{}'.format(cms_id_value) + ctxt['vsd_cms_id'] = cms_id_value log('relation data:vsd-ip-address: {}'.format(vsd_ip)) if vsd_ip is not None: ctxt['vsd_server'] = '{}:8443'.format(vsd_ip) diff --git a/hooks/neutron_api_hooks.py b/hooks/neutron_api_hooks.py index 7988b85f..3f3eded7 100755 --- a/hooks/neutron_api_hooks.py +++ b/hooks/neutron_api_hooks.py @@ -2,10 +2,8 @@ import sys import uuid -import os from subprocess import ( check_call, - check_output, ) from charmhelpers.core.hookenv import ( @@ -108,7 +106,6 @@ from charmhelpers.contrib.network.ip import ( ) from charmhelpers.contrib.openstack.context import ADDRESS_TYPES -from charmhelpers.fetch.archiveurl import ArchiveUrlFetchHandler from charmhelpers.contrib.charmsupport import nrpe from charmhelpers.contrib.hardening.harden import harden @@ -177,29 +174,6 @@ def install(): packages = determine_packages(openstack_origin) apt_install(packages, fatal=True) - if neutron_plugin == 'vsp': - source = config('nuage-tarball-url') - if source is not None: - try: - handler = ArchiveUrlFetchHandler() - packages = ['nuage-neutron'] - path = handler.install(source) - for package in packages: - package_path = os.path.join(path, package) - if os.path.exists(package_path): - log('install {0} from: {1}'.format(package, - package_path)) - check_output( - [ - 'bash', '-c', - 'cd {}; sudo python setup.py install'.format( - package_path) - ] - ) - except Exception as e: - log('install failed with error: {}'.format(e.message)) - raise Exception(e) - status_set('maintenance', 'Git install') git_install(config('openstack-origin-git')) @@ -234,8 +208,9 @@ def vsd_changed(relation_id=None, remote_unit=None): return vsd_address = '{}:8443'.format(vsd_ip_address) if os_release('neutron-server') >= 'kilo': - cms_id = relation_get('nuage-cms-id') - log("nuage-vsd-api-relation-changed : cms_id:{}".format(cms_id)) + vsd_cms_id = relation_get('nuage-cms-id') + log("nuage-vsd-api-relation-changed : cms_id:{}" + .format(vsd_cms_id)) nuage_config_file = neutron_plugin_attribute(config('neutron-plugin'), 'config', 'neutron') log('vsd-rest-api-relation-changed: ip address:{}'.format(vsd_address)) diff --git a/templates/kilo/nuage_plugin.ini b/templates/kilo/nuage_plugin.ini index bc396205..3ae47bc1 100644 --- a/templates/kilo/nuage_plugin.ini +++ b/templates/kilo/nuage_plugin.ini @@ -10,4 +10,4 @@ organization = {{ vsd_organization }} serverssl = {{ vsd_auth_ssl }} base_uri = {{ vsd_base_uri }} default_net_partition_name = {{ vsd_netpart_name }} -cms_id = {{ cms_id }} +cms_id = {{ vsd_cms_id }}