projects
/
osm
/
osmclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
return http_code,data tuple in DELETE operations for sol005 client
[osm/osmclient.git]
/
osmclient
/
scripts
/
osm.py
diff --git
a/osmclient/scripts/osm.py
b/osmclient/scripts/osm.py
index
9c3e154
..
2a321fc
100755
(executable)
--- a/
osmclient/scripts/osm.py
+++ b/
osmclient/scripts/osm.py
@@
-36,9
+36,9
@@
def check_client_version(obj, what, version='sol005'):
:raises ClientError: if the specified version does not match the client version
'''
fullclassname = obj.__module__ + "." + obj.__class__.__name__
:raises ClientError: if the specified version does not match the client version
'''
fullclassname = obj.__module__ + "." + obj.__class__.__name__
- message = '
t
he following commands or options are only supported with the option "--sol005": {}'.format(what)
+ message = '
T
he following commands or options are only supported with the option "--sol005": {}'.format(what)
if version == 'v1':
if version == 'v1':
- message = '
t
he following commands or options are not supported when using option "--sol005": {}'.format(what)
+ message = '
T
he following commands or options are not supported when using option "--sol005": {}'.format(what)
if fullclassname != 'osmclient.{}.client.Client'.format(version):
raise ClientException(message)
return
if fullclassname != 'osmclient.{}.client.Client'.format(version):
raise ClientException(message)
return
@@
-217,7
+217,12
@@
def vnfd_list2(ctx, filter):
@click.pass_context
def vnf_list(ctx):
''' list all VNF instances'''
@click.pass_context
def vnf_list(ctx):
''' list all VNF instances'''
- resp = ctx.obj.vnf.list()
+ try:
+ check_client_version(ctx.obj, ctx.command.name, 'v1')
+ resp = ctx.obj.vnf.list()
+ except ClientException as inst:
+ print(inst.message)
+ exit(1)
table = PrettyTable(
['vnf name',
'id',
table = PrettyTable(
['vnf name',
'id',
@@
-533,7
+538,8
@@
def vnfd_create2(ctx, filename, overwrite):
help='comma separated list of keys to inject to vnfs')
@click.option('--config',
default=None,
help='comma separated list of keys to inject to vnfs')
@click.option('--config',
default=None,
- help='ns specific yaml configuration')
+ help='ns specific yaml configuration:\nvnf: [member-vnf-index: TEXT, vim_account: TEXT]\n'
+ 'vld: [name: TEXT, vim-network-name: TEXT or DICT with vim_account, vim_net entries]')
@click.pass_context
def ns_create(ctx,
nsd_name,
@click.pass_context
def ns_create(ctx,
nsd_name,
@@
-544,8
+550,8
@@
def ns_create(ctx,
config):
'''creates a new NS instance'''
try:
config):
'''creates a new NS instance'''
try:
- if config:
- check_client_version(ctx.obj, '--config', 'v1')
+
#
if config:
+
#
check_client_version(ctx.obj, '--config', 'v1')
ctx.obj.ns.create(
nsd_name,
ns_name,
ctx.obj.ns.create(
nsd_name,
ns_name,