@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')
password,
auth_url,
tenant,
- floating_ip_pool,
- keypair,
config,
account_type,
description):
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
from osmclient.common.exceptions import ClientException
from osmclient.common.exceptions import NotFound
-import json
+import yaml
import time
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