old_contents: import requests
  import json
  
  from django.conf import settings
  
  from raven.contrib.django.raven_compat.models import client
  
  
  def call_api(action=None, **kwargs):
      try:
          resp = requests.request(method=("POST" if action else "GET"), json={"method": action, "args": kwargs}, url=settings.CONDUCTOR_AGENT_PATH, cert=settings.CONDUCTOR_CERT_PATH, verify=False)
      except requests.exceptions.ConnectionError:
          return None
  
      if resp.status_code == 500 or resp.status_code == 400:
          client.captureMessage("Conductor API Request Failure: {} {}\n{} {}\n".format(resp.status_code, resp.text, action, kwargs))
          return None
      return json.loads(resp.text)
  
new_contents: import requests
  import json
  
  from django.conf import settings
  
  from raven.contrib.django.raven_compat.models import client
  
  
  def call_api(action=None, **kwargs):
      try:
          resp = requests.request(method=("POST" if action else "GET"),
                                  json={"method": action, "args": kwargs},
                                  url=settings.CONDUCTOR_AGENT_PATH,
                                  cert=settings.CONDUCTOR_CERT_PATH,
                                  verify=False,
                                  timeout=10)
      except requests.exceptions.ConnectionError:
          return None
  
      if resp.status_code == 500 or resp.status_code == 400:
          client.captureMessage("Conductor API Request Failure: {} {}\n{} {}\n".format(resp.status_code, resp.text, action, kwargs))
          return None
      return json.loads(resp.text)
  
subject: add timeout to conductor api