projects
/
osm
/
osmclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Validation will fail by default if not using SOL006 format
[osm/osmclient.git]
/
osmclient
/
scripts
/
osm.py
diff --git
a/osmclient/scripts/osm.py
b/osmclient/scripts/osm.py
index
c97f984
..
3af70c6
100755
(executable)
--- a/
osmclient/scripts/osm.py
+++ b/
osmclient/scripts/osm.py
@@
-543,7
+543,7
@@
def vnfd_list(ctx, nf_type, filter, long):
table = PrettyTable(['nfpkg name', 'id', 'desc type'])
for vnfd in resp:
name = vnfd.get('id', vnfd.get('name','-'))
table = PrettyTable(['nfpkg name', 'id', 'desc type'])
for vnfd in resp:
name = vnfd.get('id', vnfd.get('name','-'))
- descriptor_type = 'sol00
5
' if 'product-name' in vnfd else 'rel8'
+ descriptor_type = 'sol00
6
' if 'product-name' in vnfd else 'rel8'
if long:
onb_state = vnfd['_admin'].get('onboardingState','-')
op_state = vnfd['_admin'].get('operationalState','-')
if long:
onb_state = vnfd['_admin'].get('onboardingState','-')
op_state = vnfd['_admin'].get('operationalState','-')
@@
-4312,7
+4312,7
@@
def package_create(ctx,
# exit(1)
@cli_osm.command(name='package-validate',
# exit(1)
@cli_osm.command(name='package-validate',
- short_help='Validate a package descriptor')
+
short_help='Validate a package descriptor')
@click.argument('base-directory',
default=".",
required=False)
@click.argument('base-directory',
default=".",
required=False)
@@
-4320,10
+4320,15
@@
def package_create(ctx,
default=True,
help='The activated recursive option will validate the yaml files'
' within the indicated directory and in its subdirectories')
default=True,
help='The activated recursive option will validate the yaml files'
' within the indicated directory and in its subdirectories')
+@click.option('--old',
+ is_flag=True,
+ default=False,
+ help='Validates also the descriptors using the previous OSM format (pre SOL006)')
@click.pass_context
def package_validate(ctx,
base_directory,
@click.pass_context
def package_validate(ctx,
base_directory,
- recursive):
+ recursive,
+ old):
"""
Validate descriptors given a base directory.
"""
Validate descriptors given a base directory.
@@
-4332,7
+4337,7
@@
def package_validate(ctx,
"""
# try:
check_client_version(ctx.obj, ctx.command.name)
"""
# try:
check_client_version(ctx.obj, ctx.command.name)
- results = ctx.obj.package_tool.validate(base_directory, recursive)
+ results = ctx.obj.package_tool.validate(base_directory, recursive
, old
)
table = PrettyTable()
table.field_names = ["TYPE", "PATH", "VALID", "ERROR"]
# Print the dictionary generated by the validation function
table = PrettyTable()
table.field_names = ["TYPE", "PATH", "VALID", "ERROR"]
# Print the dictionary generated by the validation function