def _get_svc(rcd, service_status):
 ena = None
 lines = __salt__['cmd.run']('{0} rcvar'.format(rcd)).splitlines()
 for rcvar in lines:
  if (rcvar.startswith('$') and ('={0}'.format(service_status) in rcvar)):
   ena = 'yes'
  elif rcvar.startswith('#'):
   svc = rcvar.split(' ', 1)[1]
  else:
   continue
 if (ena and svc):
  return svc
 return None

def _get_svc ( rcd , service_status ) : ena = None lines = __salt__ [ 'cmd.run' ] ( '{0} rcvar' . format ( rcd ) ) . splitlines ( ) for rcvar in lines : if ( rcvar . startswith ( '$' ) and ( '={0}' . format ( service_status ) in rcvar ) ) : ena = 'yes' elif rcvar . startswith ( '#' ) : svc = rcvar . split ( ' ' , 1 ) [ 1 ] else : continue if ( ena and svc ) : return svc return None
returns a unique service status .