def disable_beacon(name, **kwargs):
 ret = {'comment': [], 'result': True}
 if (not name):
  ret['comment'] = 'Beacon name is required.'
  ret['result'] = False
  return ret
 if (('test' in kwargs) and kwargs['test']):
  ret['comment'] = 'Beacons would be enabled.'
 else:
  _beacons = list_(return_yaml=False)
  if (name not in _beacons):
   ret['comment'] = 'Beacon {0} is not currently configured.'.format(name)
   ret['result'] = False
   return ret
  try:
   eventer = salt.utils.event.get_event('minion', opts=__opts__)
   res = __salt__['event.fire']({'func': 'disable_beacon', 'name': name}, 'manage_beacons')
   if res:
    event_ret = eventer.get_event(tag='/salt/minion/minion_beacon_disabled_complete', wait=30)
    if (event_ret and event_ret['complete']):
     beacons = event_ret['beacons']
     beacon_config_dict = _get_beacon_config_dict(beacons[name])
     if (('enabled' in beacon_config_dict) and (not beacon_config_dict['enabled'])):
      ret['result'] = True
      ret['comment'] = 'Disabled beacon {0} on minion.'.format(name)
     else:
      ret['result'] = False
      ret['comment'] = 'Failed to disable beacon on minion.'
     return ret
  except KeyError:
   ret['comment'] = 'Event module not available. Beacon disable job failed.'
 return ret

def disable_beacon ( name , ** kwargs ) : ret = { 'comment' : [ ] , 'result' : True } if ( not name ) : ret [ 'comment' ] = 'Beacon name is required.' ret [ 'result' ] = False return ret if ( ( 'test' in kwargs ) and kwargs [ 'test' ] ) : ret [ 'comment' ] = 'Beacons would be enabled.' else : _beacons = list_ ( return_yaml = False ) if ( name not in _beacons ) : ret [ 'comment' ] = 'Beacon {0} is not currently configured.' . format ( name ) ret [ 'result' ] = False return ret try : eventer = salt . utils . event . get_event ( 'minion' , opts = __opts__ ) res = __salt__ [ 'event.fire' ] ( { 'func' : 'disable_beacon' , 'name' : name } , 'manage_beacons' ) if res : event_ret = eventer . get_event ( tag = '/salt/minion/minion_beacon_disabled_complete' , wait = 30 ) if ( event_ret and event_ret [ 'complete' ] ) : beacons = event_ret [ 'beacons' ] beacon_config_dict = _get_beacon_config_dict ( beacons [ name ] ) if ( ( 'enabled' in beacon_config_dict ) and ( not beacon_config_dict [ 'enabled' ] ) ) : ret [ 'result' ] = True ret [ 'comment' ] = 'Disabled beacon {0} on minion.' . format ( name ) else : ret [ 'result' ] = False ret [ 'comment' ] = 'Failed to disable beacon on minion.' return ret except KeyError : ret [ 'comment' ] = 'Event module not available. Beacon disable job failed.' return ret
disable beacon on the minion :name: name of the beacon to disable .