OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

tosca-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [tosca-comment] error when using tosca parser


Thank you for your support ...
I added description as shown in the attached file, but I got this error message:

    tosca = ToscaTemplate(path, parsed_params, a_file)
  File "/usr/local/lib/python2.7/dist-packages/toscaparser/tosca_template.py", line 101, in __init__
    self.topology_template = self._topology_template()
  File "/usr/local/lib/python2.7/dist-packages/toscaparser/tosca_template.py", line 120, in _topology_template
    None)
  File "/usr/local/lib/python2.7/dist-packages/toscaparser/topology_template.py", line 61, in __init__
    self.groups = self._groups()
  File "/usr/local/lib/python2.7/dist-packages/toscaparser/topology_template.py", line 163, in _groups
    self.custom_defs)
  File "/usr/local/lib/python2.7/dist-packages/toscaparser/groups.py", line 29, in __init__
    custom_defs)
  File "/usr/local/lib/python2.7/dist-packages/toscaparser/entity_template.py", line 74, in __init__
    if type is not None else None
  File "/usr/local/lib/python2.7/dist-packages/toscaparser/elements/grouptype.py", line 35, in __init__
    if self.DESCRIPTION in self.defs:
TypeError: argument of type 'NoneType' is not iterable
127.0.0.1 - - [31/Oct/2017 12:33:35] "POST /deploy_template HTTP/1.1" 500 2641


For more information, the input parameters for the following source code line are:
  tosca = ToscaTemplate(path, parsed_params, a_file)
#path= the path to the yaml file
#parsed_params={}
#a_file=True

Any advice is appriciated.
thanks in advance.

2017-10-31 12:54 GMT+01:00 Manas Mal <MMal@advaoptical.com>:

Description :

 

This is mandatory, so you need to provide the description.

 

From: David Gabriel [mailto:davidgab283@gmail.com]
Sent: 31 October 2017 17:04


To: Manas Mal <MMal@advaoptical.com>
Cc: tosca-comment@lists.oasis-open.org
Subject: Re: [tosca-comment] error when using tosca parser

 

Kindly find attached my yaml file that generates this error:

 

    tosca = ToscaTemplate(path, parsed_params, a_file)

  File "/usr/local/lib/python2.7/dist-packages/toscaparser/tosca_template.py", line 101, in __init__

    self.topology_template = self._topology_template()

  File "/usr/local/lib/python2.7/dist-packages/toscaparser/tosca_template.py", line 120, in _topology_template

    None)

  File "/usr/local/lib/python2.7/dist-packages/toscaparser/topology_template.py", line 61, in __init__

    self.groups = self._groups()

  File "/usr/local/lib/python2.7/dist-packages/toscaparser/topology_template.py", line 163, in _groups

    self.custom_defs)

  File "/usr/local/lib/python2.7/dist-packages/toscaparser/groups.py", line 29, in __init__

    custom_defs)

  File "/usr/local/lib/python2.7/dist-packages/toscaparser/entity_template.py", line 74, in __init__

    if type is not None else None

  File "/usr/local/lib/python2.7/dist-packages/toscaparser/elements/grouptype.py", line 35, in __init__

    if self.DESCRIPTION in self.defs:

TypeError: argument of type 'NoneType' is not iterable

127.0.0.1 - - [31/Oct/2017 11:31:42] "POST /deploy_template HTTP/1.1" 500 2641

 

2017-10-31 12:21 GMT+01:00 Manas Mal <MMal@advaoptical.com>:

 

I assume you have given in this format:

 

tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0

 

 

Also remove the “”import”” as you are not using this.

 

 

Please attach your yaml file.

 

Thanks,

Manas

From: David Gabriel [mailto:davidgab283@gmail.com]
Sent: 31 October 2017 16:42
To: Manas Mal <MMal@advaoptical.com>
Cc: tosca-comment@lists.oasis-open.org
Subject: Re: [tosca-comment] error when using tosca parser

 

Thanks so much for your help.

When I include the proposed line, I removed also the first one of my input file.

However, I got the below errors. Do you have any other remarks regarding my input file ?

 

  File "/usr/local/lib/python2.7/dist-packages/toscaparser/tosca_template.py", line 81, in __init__

    self.tpl = YAML_LOADER(self.path, self.a_file)

  File "/usr/local/lib/python2.7/dist-packages/toscaparser/utils/yamlparser.py", line 50, in load_yaml

    return yaml.load(f.read(), Loader=yaml_loader)

  File "/usr/local/lib/python2.7/dist-packages/yaml/__init__.py", line 71, in load

    return loader.get_single_data()

  File "/usr/local/lib/python2.7/dist-packages/yaml/constructor.py", line 37, in get_single_data

    node = self.get_single_node()

  File "/usr/local/lib/python2.7/dist-packages/yaml/composer.py", line 36, in get_single_node

    document = self.compose_document()

  File "/usr/local/lib/python2.7/dist-packages/yaml/composer.py", line 58, in compose_document

    self.get_event()

  File "/usr/local/lib/python2.7/dist-packages/yaml/parser.py", line 118, in get_event

    self.current_event = self.state()

  File "/usr/local/lib/python2.7/dist-packages/yaml/parser.py", line 193, in parse_document_end

    token = self.peek_token()

  File "/usr/local/lib/python2.7/dist-packages/yaml/scanner.py", line 128, in peek_token

    self.fetch_more_tokens()

  File "/usr/local/lib/python2.7/dist-packages/yaml/scanner.py", line 220, in fetch_more_tokens

    return self.fetch_value()

  File "/usr/local/lib/python2.7/dist-packages/yaml/scanner.py", line 576, in fetch_value

    self.get_mark())

ScannerError: mapping values are not allowed here

  in "<unicode string>", line 4, column 12:

    description: example for a NSD.

               ^

 

 

Thanks in advance.

 

2017-10-31 11:54 GMT+01:00 Manas Mal <MMal@advaoptical.com>:

Hi David,

 

You need to include the version :

 

tosca_definitions_version   tosca_simple_profile_for_nfv_1_0_0

 

 

HTH

Manas

 

From: tosca-comment@lists.oasis-open.org [mailto:tosca-comment@lists.oasis-open.org] On Behalf Of David Gabriel
Sent: 31 October 2017 16:05
To: tosca-comment@lists.oasis-open.org
Subject: [tosca-comment] error when using tosca parser

 

Dears,

 

I have started using toscaparser and I got this error message:
File "/usr/local/lib/python2.7/dist-packages/toscaparser/
tosca_template.py", line 101, in __init__
self.topology_template = self._topology_template()
File "/usr/local/lib/python2.7/dist-packages/toscaparser/
tosca_template.py", line 120, in _topology_template
None)
File "/usr/local/lib/python2.7/dist-packages/toscaparser/
topology_template.py", line 61, in __init__
self.groups = self._groups()
File "/usr/local/lib/python2.7/dist-packages/toscaparser/
topology_template.py", line 163, in _groups
self.custom_defs)
File "/usr/local/lib/python2.7/dist-packages/toscaparser/
groups.py", line 29, in __init__
custom_defs)
File "/usr/local/lib/python2.7/dist-packages/toscaparser/
entity_template.py", line 74, in __init__
if type is not None else None
File "/usr/local/lib/python2.7/dist-packages/toscaparser/elements/
grouptype.py", line 35, in __init__
if self.DESCRIPTION in self.defs:
TypeError: argument of type 'NoneType' is not iterable

 

Kindly find attached my input file.

I would appreciate any kind of help.
Thanks in advance.

best regards.

 

 

 


Attachment: example.yml
Description: application/yaml



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]