def _available(name, ret):
 avail = False
 if ('service.available' in __salt__):
  avail = __salt__['service.available'](name)
 elif ('service.get_all' in __salt__):
  avail = (name in __salt__['service.get_all']())
 if (not avail):
  ret['result'] = False
  ret['comment'] = 'The named service {0} is not available'.format(name)
 return avail

def _available ( name , ret ) : avail = False if ( 'service.available' in __salt__ ) : avail = __salt__ [ 'service.available' ] ( name ) elif ( 'service.get_all' in __salt__ ) : avail = ( name in __salt__ [ 'service.get_all' ] ( ) ) if ( not avail ) : ret [ 'result' ] = False ret [ 'comment' ] = 'The named service {0} is not available' . format ( name ) return avail
check if the service is available .