Thanks to visit codestin.com
Credit goes to github.com

Skip to content

problem using colons in keys #64

@dvandok

Description

@dvandok

I use a networking component for specifying default routes in ipv6, using the routing target as the key in yaml, as such:

parameters:
  network:
    routes:
      '::0/0':
        via: ${network:ipv6:gateway}

If I do this on the highest level (node level) it's ok; but if it is done via class inclusion I get the following error. Given the double escape symbols I'm suspecting there is an issue with the use of ':' as part of the key.

Traceback (most recent call last):
  File "/usr/bin/reclass-salt", line 9, in <module>
    load_entry_point('reclass==1.4.1', 'console_scripts', 'reclass-salt')()
  File "/usr/lib/python2.7/dist-packages/reclass/adapters/salt.py", line 105, in cli
    class_mappings=class_mappings)
  File "/usr/lib/python2.7/dist-packages/reclass/adapters/salt.py", line 38, in ext_pillar
    data = reclass.nodeinfo(minion_id)
  File "/usr/lib/python2.7/dist-packages/reclass/core.py", line 136, in nodeinfo
    return self._nodeinfo_as_dict(nodename, self._nodeinfo(nodename))
  File "/usr/lib/python2.7/dist-packages/reclass/core.py", line 122, in _nodeinfo
    ret.interpolate()
  File "/usr/lib/python2.7/dist-packages/reclass/datatypes/entity.py", line 65, in interpolate
    self._parameters.interpolate()
  File "/usr/lib/python2.7/dist-packages/reclass/datatypes/parameters.py", line 180, in interpolate
    self._interpolate_inner(path, refvalue)
  File "/usr/lib/python2.7/dist-packages/reclass/datatypes/parameters.py", line 214, in _interpolate_inner
    path.set_value(self._base, new)
  File "/usr/lib/python2.7/dist-packages/reclass/utils/dictpath.py", line 125, in set_value
    self._get_innermost_container(base)[self._get_key()] = value
  File "/usr/lib/python2.7/dist-packages/reclass/utils/dictpath.py", line 106, in _get_innermost_container
    container = container[i]
KeyError: '\\:\\:0/0'

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions