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 <sunnyverma1992@gmail.com>
This commit is contained in:
sunny-verma 2016-04-16 20:46:04 -04:00 committed by David Ames
parent 7b6e6e9b6e
commit a0dddcdf03
4 changed files with 11 additions and 34 deletions

View File

@ -301,6 +301,12 @@ options:
description: | description: |
Its [nuage-openstack-neutron nuagenetlib] for Nuage VSP >=3.2R4 & KILO Its [nuage-openstack-neutron nuagenetlib] for Nuage VSP >=3.2R4 & KILO
and [nuage-neutron python-nuagenetlib] of Nuage VSP <=3.0 & JUNO 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: vsd-cms-name:
type: string type: string
default: default:
@ -337,10 +343,6 @@ options:
type: string type: string
default: juju-enterprise default: juju-enterprise
description: Name of the Organization or Enterprise to create in Nuage VSD 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 # end of Nuage VSD configuration
l2-population: l2-population:
type: boolean type: boolean

View File

@ -197,7 +197,7 @@ class NeutronCCContext(context.NeutronContext):
log('relation data:cms_id required for' log('relation data:cms_id required for'
' nuage plugin: {}'.format(cms_id_value)) ' nuage plugin: {}'.format(cms_id_value))
if cms_id_value is not None: 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)) log('relation data:vsd-ip-address: {}'.format(vsd_ip))
if vsd_ip is not None: if vsd_ip is not None:
ctxt['vsd_server'] = '{}:8443'.format(vsd_ip) ctxt['vsd_server'] = '{}:8443'.format(vsd_ip)

View File

@ -2,10 +2,8 @@
import sys import sys
import uuid import uuid
import os
from subprocess import ( from subprocess import (
check_call, check_call,
check_output,
) )
from charmhelpers.core.hookenv import ( 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.contrib.openstack.context import ADDRESS_TYPES
from charmhelpers.fetch.archiveurl import ArchiveUrlFetchHandler
from charmhelpers.contrib.charmsupport import nrpe from charmhelpers.contrib.charmsupport import nrpe
from charmhelpers.contrib.hardening.harden import harden from charmhelpers.contrib.hardening.harden import harden
@ -177,29 +174,6 @@ def install():
packages = determine_packages(openstack_origin) packages = determine_packages(openstack_origin)
apt_install(packages, fatal=True) 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') status_set('maintenance', 'Git install')
git_install(config('openstack-origin-git')) git_install(config('openstack-origin-git'))
@ -234,8 +208,9 @@ def vsd_changed(relation_id=None, remote_unit=None):
return return
vsd_address = '{}:8443'.format(vsd_ip_address) vsd_address = '{}:8443'.format(vsd_ip_address)
if os_release('neutron-server') >= 'kilo': if os_release('neutron-server') >= 'kilo':
cms_id = relation_get('nuage-cms-id') vsd_cms_id = relation_get('nuage-cms-id')
log("nuage-vsd-api-relation-changed : cms_id:{}".format(cms_id)) log("nuage-vsd-api-relation-changed : cms_id:{}"
.format(vsd_cms_id))
nuage_config_file = neutron_plugin_attribute(config('neutron-plugin'), nuage_config_file = neutron_plugin_attribute(config('neutron-plugin'),
'config', 'neutron') 'config', 'neutron')
log('vsd-rest-api-relation-changed: ip address:{}'.format(vsd_address)) log('vsd-rest-api-relation-changed: ip address:{}'.format(vsd_address))

View File

@ -10,4 +10,4 @@ organization = {{ vsd_organization }}
serverssl = {{ vsd_auth_ssl }} serverssl = {{ vsd_auth_ssl }}
base_uri = {{ vsd_base_uri }} base_uri = {{ vsd_base_uri }}
default_net_partition_name = {{ vsd_netpart_name }} default_net_partition_name = {{ vsd_netpart_name }}
cms_id = {{ cms_id }} cms_id = {{ vsd_cms_id }}