Public bug reported:

The script to convert nic config files from old-style to new-style will fail if 
the the input yaml file has a blank like followed by a comment, like this:
               -
                  type: vlan
                  vlan_id: {get_param: TenantNetworkVlanID}
                  addresses:
                    -
                      ip_netmask: {get_param: TenantIpSubnet}

                # Uncomment when including environments/network-management.yaml
                -
                  type: vlan
                  vlan_id: {get_param: ManagementNetworkVlanID}
                  addresses:
                    -
                      ip_netmask: {get_param: ManagementIpSubnet}


It will result in this error:
Converting nic-configs/controller.yaml
Traceback (most recent call last):
  File 
"/usr/share/openstack-tripleo-heat-templates/tools/yaml-nic-config-2-script.py",
 line 155, in convert
    tpl = yaml.load(open(filename).read(), Loader=TemplateLoader)
  File "/usr/lib64/python2.7/site-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/lib64/python2.7/site-packages/yaml/constructor.py", line 37, in 
get_single_data
    node = self.get_single_node()
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 36, in 
get_single_node
    document = self.compose_document()
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 55, in 
compose_document
    node = self.compose_node(None, None)
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 84, in 
compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib64/python2.7/site-packages/yaml/composer.py", line 127, in 
compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/lib64/python2.7/site-packages/yaml/parser.py", line 98, in 
check_event
    self.current_event = self.state()
  File "/usr/lib64/python2.7/site-packages/yaml/parser.py", line 439, in 
parse_block_mapping_key
    "expected <block end>, but found %r" % token.id, token.start_mark)
ParserError: while parsing a block mapping
  in "<string>", line 1, column 1:
    heat_template_version: 2015-04-30
    ^
expected <block end>, but found '<block sequence start>'
  in "<string>", line 171, column 13:

This is because the first pass of converting the file doesn't properly
indent the commented line if its preceded by a blank line.

** Affects: tripleo-heat-templates (Ubuntu)
     Importance: Undecided
     Assignee: Bob Fournier (bfournie)
         Status: New

** Changed in: tripleo-heat-templates (Ubuntu)
     Assignee: (unassigned) => Bob Fournier (bfournie)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1779191

Title:
  nic config conversion script fails if input file has blank line
  followed by comment

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tripleo-heat-templates/+bug/1779191/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to