Commit 6a103282 authored by Luciano Cauzzi's avatar Luciano Cauzzi

Fixed error code

parent 0aa2b214
......@@ -68,7 +68,7 @@ class AppPyramidManager:
s = self.__network_manager__.get_session()
payload = json.dumps(doc.to_dict())
response = s.post(url, data=payload, headers=headers, timeout=AppPyramidManager.TIMEOUT)
if response.status_code == 201:
if response.status_code == 401:
self.login()
return self.save(doc)
return AppPyramidManager.__manage_response__(response.status_code, operation_name, result=None)
......@@ -89,7 +89,7 @@ class AppPyramidManager:
+ query_id + "\"] \n }\n }\n}"
s = self.__network_manager__.get_session()
response = s.get(url, data=payload, headers=headers, timeout=AppPyramidManager.TIMEOUT)
if response.status_code == 201:
if response.status_code == 401:
self.login()
return self.exists(query_header, query_id)
json_obj = json.loads(response.text)
......@@ -108,7 +108,7 @@ class AppPyramidManager:
s = self.__network_manager__.get_session()
payload = json.dumps(doc.to_dict())
response = s.put(url, data=payload, headers=headers, timeout=AppPyramidManager.TIMEOUT)
if response.status_code == 201:
if response.status_code == 401:
self.login()
return self.update(elastic_id, doc)
return AppPyramidManager.__manage_response__(response.status_code, operation_name, None)
......
......@@ -3,7 +3,7 @@ import setuptools
setup(
name='network_manager',
version='0.1.5',
version='0.1.6',
packages=setuptools.find_packages(),
dependency_links=['http://github.comune.brescia.it/innovation-that-excites/logger_library#egg=logger_library'],
install_requires=['logger_library', 'dependency_injector', 'requests'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment