def enabled_service_owners():
 error = {}
 if ('pkg.owner' not in __salt__):
  error['Unsupported Package Manager'] = 'The module for the package manager on this system does not support looking up which package(s) owns which file(s)'
 if ('service.show' not in __salt__):
  error['Unsupported Service Manager'] = 'The module for the service manager on this system does not support showing descriptive service data'
 if error:
  return {'Error': error}
 ret = {}
 services = __salt__['service.get_enabled']()
 for service in services:
  data = __salt__['service.show'](service)
  if ('ExecStart' not in data):
   continue
  start_cmd = data['ExecStart']['path']
  pkg = __salt__['pkg.owner'](start_cmd)
  ret[service] = next(six.itervalues(pkg))
 return ret

def enabled_service_owners ( ) : error = { } if ( 'pkg.owner' not in __salt__ ) : error [ 'Unsupported Package Manager' ] = 'The module for the package manager on this system does not support looking up which package(s) owns which file(s)' if ( 'service.show' not in __salt__ ) : error [ 'Unsupported Service Manager' ] = 'The module for the service manager on this system does not support showing descriptive service data' if error : return { 'Error' : error } ret = { } services = __salt__ [ 'service.get_enabled' ] ( ) for service in services : data = __salt__ [ 'service.show' ] ( service ) if ( 'ExecStart' not in data ) : continue start_cmd = data [ 'ExecStart' ] [ 'path' ] pkg = __salt__ [ 'pkg.owner' ] ( start_cmd ) ret [ service ] = next ( six . itervalues ( pkg ) ) return ret
return which packages own each of the services that are currently enabled .