From: Mike Marchetti Date: Mon, 13 Nov 2017 15:51:42 +0000 (-0500) Subject: update vim config X-Git-Tag: v3.0.2~3 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=7a1d77c2e4a74d7b24ef6644a032841d514c06d9;p=osm%2Fosmclient.git update vim config - use yaml for vim config Change-Id: I3e449b101cca01239472863e1a425b243c33659a Signed-off-by: Mike Marchetti --- diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index 23f6889..3c73510 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -407,10 +407,6 @@ def config_agent_add(ctx, name, account_type, server, user, secret): @click.option('--tenant', prompt=True, help='tenant name') -@click.option('--floating_ip_pool', - default=None) -@click.option('--keypair', - default=None) @click.option('--config', default=None, help='VIM specific config parameters') @@ -426,8 +422,6 @@ def vim_create(ctx, password, auth_url, tenant, - floating_ip_pool, - keypair, config, account_type, description): @@ -436,8 +430,6 @@ def vim_create(ctx, vim['vim-password'] = password vim['vim-url'] = auth_url vim['vim-tenant-name'] = tenant - vim['floating_ip_pool'] = floating_ip_pool - vim['keypair'] = keypair vim['config'] = config vim['vim-type'] = account_type vim['description'] = description diff --git a/osmclient/v1/vim.py b/osmclient/v1/vim.py index b0033a1..dd6a5e0 100644 --- a/osmclient/v1/vim.py +++ b/osmclient/v1/vim.py @@ -20,7 +20,7 @@ OSM vim API handling from osmclient.common.exceptions import ClientException from osmclient.common.exceptions import NotFound -import json +import yaml import time @@ -65,17 +65,8 @@ class Vim(object): vim_account['datacenter']['type'] = vim_access['vim-type'] vim_config = {} - vim_config['use_floating_ip'] = False - - if ('floating_ip_pool' in vim_access and - vim_access['floating_ip_pool'] is not None): - vim_config['use_floating_ip'] = True - - if 'keypair' in vim_access and vim_access['keypair'] is not None: - vim_config['keypair'] = vim_access['keypair'] - elif 'config' in vim_access and vim_access['config'] is not None: - if any(var in vim_access['config'] for var in ["admin_password","admin_username","orgname","nsx_user","nsx_password","nsx_manager","vcenter_ip","vcenter_port","vcenter_user","vcenter_password"]): - vim_config = json.loads(vim_access['config']) + if 'config' in vim_access and vim_access['config'] is not None: + vim_config = yaml.load(vim_access['config']) vim_account['datacenter']['config'] = vim_config