def reg(name):
 ret = {'name': name, 'changes': {}, 'comment': '', 'result': True}
 now = time.time()
 if ('status' not in __reg__):
  __reg__['status'] = {}
  __reg__['status']['val'] = {}
 for event in __events__:
  if fnmatch.fnmatch(event['tag'], 'salt/beacon/*/status/*'):
   idata = {'recv_time': now}
   for key in event['data']['data']:
    if (key in ('id', 'recv_time')):
     continue
    idata[key] = event['data'][key]
   __reg__['status']['val'][event['data']['data']['id']] = idata
   ret['changes'][event['data']['data']['id']] = True
 return ret

def reg ( name ) : ret = { 'name' : name , 'changes' : { } , 'comment' : '' , 'result' : True } now = time . time ( ) if ( 'status' not in __reg__ ) : __reg__ [ 'status' ] = { } __reg__ [ 'status' ] [ 'val' ] = { } for event in __events__ : if fnmatch . fnmatch ( event [ 'tag' ] , 'salt/beacon/*/status/*' ) : idata = { 'recv_time' : now } for key in event [ 'data' ] [ 'data' ] : if ( key in ( 'id' , 'recv_time' ) ) : continue idata [ key ] = event [ 'data' ] [ key ] __reg__ [ 'status' ] [ 'val' ] [ event [ 'data' ] [ 'data' ] [ 'id' ] ] = idata ret [ 'changes' ] [ event [ 'data' ] [ 'data' ] [ 'id' ] ] = True return ret
activate this register to turn on a minion status tracking register .