def _frontend_url():
 hostname = socket.gethostname()
 frontend_url = (('http://' + hostname) + '/zabbix/api_jsonrpc.php')
 try:
  try:
   response = salt.utils.http.query(frontend_url)
   error = response['error']
  except HTTPError as http_e:
   error = str(http_e)
  if error.find('412: Precondition Failed'):
   return frontend_url
  else:
   raise KeyError
 except (ValueError, KeyError):
  return False

def _frontend_url ( ) : hostname = socket . gethostname ( ) frontend_url = ( ( 'http://' + hostname ) + '/zabbix/api_jsonrpc.php' ) try : try : response = salt . utils . http . query ( frontend_url ) error = response [ 'error' ] except HTTPError as http_e : error = str ( http_e ) if error . find ( '412: Precondition Failed' ) : return frontend_url else : raise KeyError except ( ValueError , KeyError ) : return False
tries to guess the url of zabbix frontend .