beacons.enable_beacon does not write to beacons.conf on some OS's
Expected Behavior
Running beacons.enable_beacon <beacon> then saving the beacon with beacons.save should write enabled: True to the beacons.conf file
Expected beacons.conf after the save should be similar to this:
beacons:
ps:
apache: stopped
enabled: true
Actual Behavior
Saving an enabled beacon does not write to the beacons.conf. I've seen this on Ubuntu 12.04, CentOS 5/6, and Fedora 22.
Steps to Reproduce Issue
On the master:
λ jutt-main ~ → salt jutt_fed22 beacons.add ps "{'apache2': 'stopped'}"
jutt_fed22:
----------
comment:
Added beacon: ps.
result:
True
λ jutt-main ~ → salt jutt_fed22 beacons.save
...
λ jutt-main ~ → salt jutt_fed22 beacons.enable_beacon ps
jutt_fed22:
----------
comment:
Enabled beacon ps on minion.
result:
True
λ jutt-main ~ → salt jutt_fed22 beacons.save
jutt_fed22:
----------
comment:
Beacons saved to /etc/salt/minion.d/beacons.conf.
result:
True
On the minion:
cat /etc/salt/minion.d/beacons.conf
beacons:
enabled: true
ps:
apache2: stopped
Versions Report
Master version report:
Salt Version:
Salt: 2015.8.7
Dependency Versions:
Jinja2: 2.8
M2Crypto: 0.21.1
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
Python: 2.7.11 (default, Dec 6 2015, 15:43:46)
RAET: Not Installed
Tornado: 4.3
ZMQ: 4.1.3
cffi: 1.5.2
cherrypy: 3.8.0
dateutil: 2.4.2
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: Not Installed
libgit2: Not Installed
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.7
mysql-python: 1.2.5
pycparser: 2.14
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: 0.3.7
smmap: 0.9.0
timelib: 0.2.4
System Versions:
dist:
machine: x86_64
release: 4.1.3
Minion version report:
Salt Version:
Salt: 2015.8.3
Dependency Versions:
Jinja2: 2.7.3
M2Crypto: 0.21.1
Mako: Not Installed
PyYAML: 3.11
PyZMQ: 14.4.1
Python: 2.7.10 (default, Sep 24 2015, 17:50:09)
RAET: Not Installed
Tornado: 4.1
ZMQ: 4.0.5
cffi: 0.8.6
cherrypy: 5.0.1
dateutil: Not Installed
gitdb: 0.6.4
gitpython: 1.0.2
ioflo: 1.5.0
libnacl: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: 1.3.6
pycparser: 2.10
pycrypto: 2.6.1
pygit2: Not Installed
python-gnupg: 0.3.8
smmap: 0.9.0
timelib: 0.2.4
System Versions:
dist: fedora 22 Twenty Two
machine: x86_64
release: 4.4.0-x86_64-linode63
system: Fedora 22 Twenty Two
This is also happening on 2015.5.8/9
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
This still needs to be looked at.
Cannot reproduce on 3006.x/3007.x/3008.x/master. Beacon._update_enabled and beacons.save produce the expected per-beacon enabled: true (no spurious top-level enabled) for both dict- and list-shaped beacon configs. Test gated on #31516 in tests/pytests/integration/modules/test_beacons.py::test_enabled_beacons was skipped in #31561 and never re-enabled; its current assertion still encodes the buggy expectation. @justinta @dwoz — still seeing this on a current Salt? If not I'll send a PR un-skipping and inverting that test, and close.
Fix merged and shipped in a supported release. Closing per bulk triage. Reopen if this reproduces on a currently supported release (3006.x, 3007.x, 3008.x, master).