Fixup! beacons/avahi_announce.py finding grains

This pull resquest broke the avahi_announce
https://github.com/saltstack/salt/pull/45657
because len('grains.') is 7 and not 6 as this
change say.
What happens now is that is looking in
__grains__ for '.{grain_name}' instead of {grain_name}.

Signed-off-by: Rares POP <rares.pop@ni.com>
This commit is contained in:
Rares POP 2018-05-31 14:43:15 +03:00 committed by rallytime
parent b88ec5258d
commit c51e732f4d
No known key found for this signature in database
GPG key ID: E8F1A4B90D0DEA19

View file

@ -182,7 +182,7 @@ def beacon(config):
for item in _config['txt']:
changes_key = 'txt.' + salt.utils.stringutils.to_unicode(item)
if _config['txt'][item].startswith('grains.'):
grain = _config['txt'][item][6:]
grain = _config['txt'][item][7:]
grain_index = None
square_bracket = grain.find('[')
if square_bracket != -1 and grain[-1] == ']':