Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge of empty dict and dict with entries doesn't work #10

Closed
t2d opened this issue Jan 11, 2016 · 1 comment
Closed

Merge of empty dict and dict with entries doesn't work #10

t2d opened this issue Jan 11, 2016 · 1 comment

Comments

@t2d
Copy link

t2d commented Jan 11, 2016

# common.yaml
test:
  - entry
# node.yaml
test:

Traceback:

  File "./inventory/hiera.py", line 91, in get_inventory
    method=hiyapyco.METHOD_MERGE)
  File "build/bdist.linux-x86_64/egg/hiyapyco/__init__.py", line 410, in load
  File "build/bdist.linux-x86_64/egg/hiyapyco/__init__.py", line 200, in __init__
  File "build/bdist.linux-x86_64/egg/hiyapyco/__init__.py", line 347, in _deepmerge
  File "build/bdist.linux-x86_64/egg/hiyapyco/__init__.py", line 339, in _deepmerge
hiyapyco.HiYaPyCoImplementationException: can not merge <type 'NoneType'> to <type 'list'> (@ "['entry']"  try to merge "None")
@t2d t2d changed the title Merge of empty dict and dict with entires doesn't work Merge of empty dict and dict with entries doesn't work Jan 11, 2016
@zerwes
Copy link
Owner

zerwes commented Jan 14, 2016

leave empty vars away or you should init your empty yaml vars correctly for type safety:
test: []
or
xxx: {}
or
strlar: ''
or
....

if this is not a option for your setup I could implement a kwargs i.e. allowmergeintononetype=bool that will default to False in order to preserve type safety and backwards compatibility bot may allow you to force merging of any type into vars w/ None value.

@zerwes zerwes closed this as completed Jan 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants