def _get_svc_path(name='*', status=None):
 if (not SERVICE_DIR):
  raise CommandExecutionError('Could not find service directory.')
 ena = set()
 for el in glob.glob(os.path.join(SERVICE_DIR, name)):
  if _is_svc(el):
   ena.add(os.readlink(el))
   log.trace('found enabled service path: {0}'.format(el))
 if (status == 'ENABLED'):
  return sorted(ena)
 ava = set()
 for d in AVAIL_SVR_DIRS:
  for el in glob.glob(os.path.join(d, name)):
   if _is_svc(el):
    ava.add(el)
    log.trace('found available service path: {0}'.format(el))
 if (status == 'DISABLED'):
  ret = ava.difference(ena)
 else:
  ret = ava.union(ena)
 return sorted(ret)

def _get_svc_path ( name = '*' , status = None ) : if ( not SERVICE_DIR ) : raise CommandExecutionError ( 'Could not find service directory.' ) ena = set ( ) for el in glob . glob ( os . path . join ( SERVICE_DIR , name ) ) : if _is_svc ( el ) : ena . add ( os . readlink ( el ) ) log . trace ( 'found enabled service path: {0}' . format ( el ) ) if ( status == 'ENABLED' ) : return sorted ( ena ) ava = set ( ) for d in AVAIL_SVR_DIRS : for el in glob . glob ( os . path . join ( d , name ) ) : if _is_svc ( el ) : ava . add ( el ) log . trace ( 'found available service path: {0}' . format ( el ) ) if ( status == 'DISABLED' ) : ret = ava . difference ( ena ) else : ret = ava . union ( ena ) return sorted ( ret )
return a list of paths to services with name that have the specified status name a glob for service name .