def _check_available(name):
 _status = _systemctl_status(name)
 sd_version = salt.utils.systemd.version(__context__)
 if ((sd_version is not None) and (sd_version >= 231)):
  return (0 <= _status['retcode'] < 4)
 out = _status['stdout'].lower()
 if ('could not be found' in out):
  return False
 for line in salt.utils.itertools.split(out, '\n'):
  match = re.match('\\s+loaded:\\s+(\\S+)', line)
  if match:
   ret = (match.group(1) != 'not-found')
   break
 else:
  raise CommandExecutionError(("Failed to get information on unit '%s'" % name))
 return ret

def _check_available ( name ) : _status = _systemctl_status ( name ) sd_version = salt . utils . systemd . version ( __context__ ) if ( ( sd_version is not None ) and ( sd_version >= 231 ) ) : return ( 0 <= _status [ 'retcode' ] < 4 ) out = _status [ 'stdout' ] . lower ( ) if ( 'could not be found' in out ) : return False for line in salt . utils . itertools . split ( out , '\n' ) : match = re . match ( '\\s+loaded:\\s+(\\S+)' , line ) if match : ret = ( match . group ( 1 ) != 'not-found' ) break else : raise CommandExecutionError ( ( "Failed to get information on unit '%s'" % name ) ) return ret
returns boolean telling whether or not the named service is available .