def id_(reset=False):
 if reset:
  id_pattern = re.compile('Monit id (?P<id>[^ ]+)')
  cmd = 'echo y|monit -r'
  out = __salt__['cmd.run_all'](cmd, python_shell=True)
  ret = id_pattern.search(out['stdout']).group('id')
  return (ret if ret else False)
 else:
  cmd = 'monit -i'
  out = __salt__['cmd.run'](cmd)
  ret = out.split(':')[(-1)].strip()
 return ret

def id_ ( reset = False ) : if reset : id_pattern = re . compile ( 'Monit id (?P<id>[^ ]+)' ) cmd = 'echo y|monit -r' out = __salt__ [ 'cmd.run_all' ] ( cmd , python_shell = True ) ret = id_pattern . search ( out [ 'stdout' ] ) . group ( 'id' ) return ( ret if ret else False ) else : cmd = 'monit -i' out = __salt__ [ 'cmd.run' ] ( cmd ) ret = out . split ( ':' ) [ ( - 1 ) ] . strip ( ) return ret
return the id .