def refresh_modules(async=True):
 try:
  if async:
   ret = __salt__['event.fire']({}, 'module_refresh')
  else:
   eventer = salt.utils.event.get_event('minion', opts=__opts__, listen=True)
   ret = __salt__['event.fire']({'notify': True}, 'module_refresh')
   log.trace('refresh_modules waiting for module refresh to complete')
   eventer.get_event(tag='/salt/minion/minion_mod_complete', wait=30)
 except KeyError:
  log.error('Event module not available. Module refresh failed.')
  ret = False
 return ret

def refresh_modules ( async = True ) : try : if async : ret = __salt__ [ 'event.fire' ] ( { } , 'module_refresh' ) else : eventer = salt . utils . event . get_event ( 'minion' , opts = __opts__ , listen = True ) ret = __salt__ [ 'event.fire' ] ( { 'notify' : True } , 'module_refresh' ) log . trace ( 'refresh_modules waiting for module refresh to complete' ) eventer . get_event ( tag = '/salt/minion/minion_mod_complete' , wait = 30 ) except KeyError : log . error ( 'Event module not available. Module refresh failed.' ) ret = False return ret
signal the minion to refresh the module and grain data the default is to refresh module asynchronously .