Ok, I just confirmed with Haibin that nfv-toscaparser itself have an internal 
bug https://jira.opnfv.org/projects/PARSER/issues/PARSER-187

We need a little tweak in nfv-toscaparser code to get the –debug working.

-Lianhao

From: [email protected] [mailto:[email protected]]
Sent: Monday, November 19, 2018 3:55 PM
To: Lu, Lianhao <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; 
[email protected]
Subject: 答复: RE: Re: [onap-discuss] About the annotation_types in service 
packages


we use this version: nfv-toscaparser==0.5.1.dev25.

when it meets the following your stack, it will trigger error and can not get 
the template.

I will try the new verison you provided.


原始邮件
发件人:Lu,Lianhao <[email protected]<mailto:[email protected]>>
收件人:张茂鹏10030173;[email protected] 
<[email protected]<mailto:[email protected]>>;
抄送人:[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>;[email protected]
 <[email protected]<mailto:[email protected]>>;[email protected] 
<[email protected]<mailto:[email protected]>>;
日 期 :2018年11月19日 15:04
主 题 :RE: Re: [onap-discuss] About the annotation_types in service packages
Maopen,

Which version of nfv-toscaparser are you using?  Here is mine output using 
nfv-toscaparser with debug options:

$ tosca-parser --debug --template-file ./resource-LluVgw8-csar.csar
======== main service template ========

The input "./resource-LluVgw8-csar.csar" failed validation with the following 
error(s):

        UnknownFieldError: Template {'annotations': {'file': 
'annotations.yml'}} contains unknown field "annotation_types". Refer to the 
definition to verify  valid values.
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/bin/tosca-parser, line 11, in <module>
                        load_entry_point('nfv-toscaparser', 'console_scripts', 
'tosca-parser')()
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/shell.py,
 line  153, in main
                        ParserShell().main(args)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/shell.py,
 line  77, in main
                        self.parse(path, no_required_paras_check=nrpv, 
debug_mode=debug)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/shell.py,
 line  92, in parse
                        debug_mode=debug_mode)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/tosca_template.py,
  line 90, in __init__
                        self.path = self._get_path(path)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/tosca_template.py,
  line 311, in _get_path
                        if csar.validate():
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/prereq/csar.py,
  line 124, in validate
                        self._validate_external_references()
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/prereq/csar.py,
  line 204, in _validate_external_references
                        os.path.join(self.temp_dir, main_tpl_file))
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/imports.py,
  line 55, in __init__
                        self._validate_and_load_imports()
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/imports.py,
  line 91, in _validate_and_load_imports
                        TypeValidation(custom_type, import_def)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/elements/tosca_type_validation.py,
  line 39, in __init__
                        self._validate_type_keys(custom_types)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/elements/tosca_type_validation.py,
  line 53, in _validate_type_keys
                        field=name))

        MissingRequiredFieldError: Data value of type 
"org.openecomp.datatypes.Naming" is missing required field 
"['supplemental_data']".
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/bin/tosca-parser, line 11, in <module>
                        load_entry_point('nfv-toscaparser', 'console_scripts', 
'tosca-parser')()
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/shell.py,
 line  153, in main
                        ParserShell().main(args)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/shell.py,
 line  77, in main
                        self.parse(path, no_required_paras_check=nrpv, 
debug_mode=debug)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/shell.py,
 line  92, in parse
                        debug_mode=debug_mode)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/tosca_template.py,
  line 112, in __init__
                        self.topology_template = self._topology_template()
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/tosca_template.py,
  line 132, in _topology_template
                        self.sub_mapped_node_template)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/topology_template.py,
  line 55, in __init__
                        self.inputs = self._inputs()
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/topology_template.py,
  line 75, in _inputs
                        input.validate(default)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/parameters.py,
  line 69, in validate
                        self._validate_value(value)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/parameters.py,
  line 97, in _validate_value
                        DataEntity.validate_datatype(self.type, value, None, 
datatype)
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/dataentity.py,
  line 167, in validate_datatype
                        return data.validate()
                File 
/home/lulianhao/onap/vnfsdk/pkgtools/venv/local/lib/python2.7/site-packages/nfv_toscaparser-1.0.2.dev4-py2.7.egg/toscaparser/dataentity.py,
  line 90, in validate
                        % self.datatype.type), required=missingprop))

No handlers could be found for logger "tosca.model"

version: tosca_simple_yaml_1_1

inputs:
        vf_module_id
        install_script_version
        nf_naming
        onap_private_net_id
        max_instances
        onap_private_net_cidr
        vgw_private_ip_1
        vgw_private_ip_0
        dcae_collector_port
        cpe_public_net_id
        multi_stage_design
        vg_vgmux_tunnel_vni
        nf_type
        availability_zone_max_count
        cloud_env
        vgw_private_ip_2
        nexus_artifact_repo
        cpe_public_net_cidr
        vnf_id
        nf_naming_code
        mux_gw_private_net_id
        vcpe_image_name
        vgw_name_0
        demo_artifacts_version
        mux_ip_addr
        nf_role
        dcae_collector_ip
        mux_gw_private_net_cidr
        min_instances
        public_net_id
        pub_key
        nf_function

nodetemplates:
        VL_cpe_public
        VL_mux_gw_private_net
        Cp_vgw_mux_gw_private_net
        Cp_vgw_onap_private
        VirtualStorage_root_all
        Cp_vgw_public
        VDU_vgw_0
        Cp_vgw_cpe_public
        LLU_VNF

$ pip freeze | grep toscaparser
nfv-toscaparser==1.0.2.dev4


From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]]
Sent: Monday, November 19, 2018 1:29 PM
To: Lu, Lianhao <[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]>
Cc: [email protected]<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>
Subject: 答复: Re: [onap-discuss] About the annotation_types in service packages


Thanks for the information, but I do not see any sdc fix in R3 for this bug now.



I test it with standard tosca parser, it will trigger verify error, not ignore 
it.

Should we change standard parser, and not care and verfiy the tosca simple 
grammar?

I do not know it is a right way, however the down load package API between the 
SDC and VFC about this issue is not compatible.



Best Regards

Maopeng
原始邮件
发件人:LianhaoLu <[email protected]<mailto:[email protected]>>
收件人:[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>;张茂鹏10030173;[email protected]
  <[email protected]<mailto:[email protected]>>;[email protected] 
<[email protected]<mailto:[email protected]>>;
抄送人:[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>;
日 期 :2018年11月19日  12:04
主 题 :Re: [onap-discuss] About the annotation_types in service packages
There is already a bug https://jira.onap.org/browse/SDC-1897 filed for this.

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of maopeng
Sent: Monday, November 19, 2018 10:40 AM
To: [email protected]<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>
Cc: [email protected]<mailto:[email protected]>
Subject: [onap-discuss] About the annotation_types in service packages


Hello SDC forkers:



    There is a issue in vCPE TOSCA case, which needs your help.

    In the vCPE service package output from SDC, there is a new type 
definition:annotation_types, which is   not a TOSCA standard type in TOSCA 1.1 
or 1.2.  If I am wrong, please correct me.

    In R1&R2, there is no this new types.   This new packages does not 
compatible with the R1&R2. This new type will effects VoLTE and vCPE cases.

   Could the SDC remove the annotations from the template import section if the 
tosca template does not use it? thanks



Tosca service template import sections:

imports:

......

- annotations:

    file: annotations.yml

.......



The following is content of annotations:

tosca_definitions_version: tosca_simple_yaml_1_1

imports:

- data.yml

annotation_types:

  org.openecomp.annotations.Source:

    description: Indicates the origin source of an input

    properties:

      source_type:

        type: string

      vf_module_label:

        type: list

        description: List of VF Modules this input was originated from

        entry_schema:

          type: string

      param_name:

        type: string

        description: Source parameter name



Best Regards

Maopeng















-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#13840): https://lists.onap.org/g/onap-discuss/message/13840
Mute This Topic: https://lists.onap.org/mt/28239751/21656
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to