mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-07-17 11:23:36 +08:00
Ensuring calls default to the values found by the Settings object in indicoio.config
This commit is contained in:
@@ -13,16 +13,18 @@ def api_handler(arg, cloud, api, batch=False, auth=None, **kwargs):
|
||||
json_data = json.dumps(data)
|
||||
|
||||
if cloud:
|
||||
host = "%s.indico.domains"
|
||||
host = "%s.indico.domains" % cloud
|
||||
else:
|
||||
# default to indico public cloud
|
||||
host = config.public_api_host
|
||||
host = config.PUBLIC_API_HOST
|
||||
|
||||
url = "http://%s/%s" % (host, api)
|
||||
|
||||
if batch:
|
||||
url += "/batch"
|
||||
|
||||
if not auth:
|
||||
auth = config.AUTH
|
||||
|
||||
response = requests.post(url, data=json_data, headers=JSON_HEADERS, auth=auth).json()
|
||||
results = response.get('results', False)
|
||||
if results is False:
|
||||
|
||||
Reference in New Issue
Block a user