Commit af919f68 authored by Georgios Dagkakis's avatar Georgios Dagkakis

erp5_dqe: Return empty dict in timeout or failure

anyway, what happened is stored in the HTTP Exchange
parent eb353856
...@@ -15,9 +15,6 @@ class DQEDataValidatorClientConnector(XMLObject): ...@@ -15,9 +15,6 @@ class DQEDataValidatorClientConnector(XMLObject):
params=None, params=None,
archive_kw=None, archive_kw=None,
): ):
TIMEOUT = -1
FAILURE = -2
if params is None: if params is None:
params = {} params = {}
params['Licence'] = self.getLicenseNumber() params['Licence'] = self.getLicenseNumber()
...@@ -28,7 +25,7 @@ class DQEDataValidatorClientConnector(XMLObject): ...@@ -28,7 +25,7 @@ class DQEDataValidatorClientConnector(XMLObject):
response = requests.get(base_url, params=params, timeout=self.getTimeout()) response = requests.get(base_url, params=params, timeout=self.getTimeout())
except (Timeout, timeout, ConnectionError): except (Timeout, timeout, ConnectionError):
raw_response = 'TIMEOUT' raw_response = 'TIMEOUT'
result_dict = {'1': {self.getPortalObject().Base_getDQEServiceToErrorKeyDict().get(service): TIMEOUT}} result_dict = {}
else: else:
if response.ok: if response.ok:
raw_response = response.content raw_response = response.content
...@@ -39,7 +36,7 @@ class DQEDataValidatorClientConnector(XMLObject): ...@@ -39,7 +36,7 @@ class DQEDataValidatorClientConnector(XMLObject):
'DQEDataValidatorClientConnector returns Non-ok response : %s' % response.text 'DQEDataValidatorClientConnector returns Non-ok response : %s' % response.text
) )
raw_response = response.text raw_response = response.text
result_dict = {'1': {self.getPortalObject().Base_getDQEServiceToErrorKeyDict().get(service): FAILURE}} result_dict = {}
finally: finally:
archiveExchange = self._getTypeBasedMethod('archiveExchange') archiveExchange = self._getTypeBasedMethod('archiveExchange')
if archiveExchange is not None: if archiveExchange is not None:
......
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