mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
Fixing the beacons.reset function. Once the reset has taken place in beacons/__init__.py we need to fire an event back to complete the loop and ensure that everything worked as expected.
This commit is contained in:
parent
ee3cbc7ca5
commit
353f9d4eb8
@ -434,3 +434,14 @@ class Beacon(object):
|
||||
Reset the beacons to defaults
|
||||
'''
|
||||
self.opts['beacons'] = {}
|
||||
|
||||
comment = 'Beacon Reset'
|
||||
complete = True
|
||||
|
||||
# Fire the complete event back along with updated list of beacons
|
||||
evt = salt.utils.event.get_event('minion', opts=self.opts)
|
||||
evt.fire_event({'complete': complete, 'comment': comment,
|
||||
'beacons': self.opts['beacons']},
|
||||
tag='/salt/minion/minion_beacon_reset_complete')
|
||||
|
||||
return True
|
||||
|
@ -614,7 +614,7 @@ def reset(**kwargs):
|
||||
ret = {'comment': [],
|
||||
'result': True}
|
||||
|
||||
if 'test' in kwargs and kwargs['test']:
|
||||
if kwargs.get('test'):
|
||||
ret['comment'] = 'Beacons would be reset.'
|
||||
else:
|
||||
try:
|
||||
@ -629,7 +629,7 @@ def reset(**kwargs):
|
||||
ret['comment'] = 'Beacon configuration reset.'
|
||||
else:
|
||||
ret['result'] = False
|
||||
ret['comment'] = event_ret['comment']
|
||||
ret['comment'] = 'Something went wrong.'
|
||||
return ret
|
||||
except KeyError:
|
||||
# Effectively a no-op, since we can't really return without an event system
|
||||
|
Loading…
Reference in New Issue
Block a user