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

Bug in beacons.conf (only with salt 2016.11.2) #289

Closed
BernhardGruen opened this issue Jan 31, 2017 · 2 comments
Closed

Bug in beacons.conf (only with salt 2016.11.2) #289

BernhardGruen opened this issue Jan 31, 2017 · 2 comments

Comments

@BernhardGruen
Copy link

Hi,

I've just upgraded one minion to 2016.11.2 and there is a bug in the beacons.conf Jinja template:
Current (original) template:

{%- set beacons = salt['pillar.get']('salt:beacons') -%}
{%- set beacons = salt['pillar.get']('salt:minion:beacons', default=beacons, merge=True) -%}
{%- if beacons %}
beacons:
  {{ beacons | yaml(False) | indent(2) }}
{%- endif -%}

Getting the following error:

              Unable to manage file: Problem running salt function in Jinja template: default must be a dictionary when merge=True; line 5            
              ---
              {%- set beacons = salt['pillar.get']('salt:beacons') -%}
              {%- set beacons = salt['pillar.get']('salt:minion:beacons', default=beacons, merge=True) -%}    <======================

Proposed solution (added a default value to the first beacons line):

#
# This file is managed by Salt! Do not edit by hand!
#
{%- set beacons = salt['pillar.get']('salt:beacons', default={}) -%}
{%- set beacons = salt['pillar.get']('salt:minion:beacons', default=beacons, merge=True) -%}
{%- if beacons %}
beacons:
  {{ beacons | yaml(False) | indent(2) }}
{%- endif -%}

I hope this simple bugfix helps someone.

Bernhard J. M. Grün

@aboe76
Copy link
Member

aboe76 commented Jan 31, 2017

See:
#288

@aboe76
Copy link
Member

aboe76 commented Feb 1, 2017

fixed with merged.

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