Issue-ID: OPTFRA-946
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
Change-Id: I6ccf61b6e07187f879d52c4c3b9f53b4188adf4a
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
-import re
-from datetime import datetime, timedelta
+from datetime import datetime
+from datetime import timedelta
from flask import request
from flask import request
from osdf.config.base import osdf_config
from osdf.config.base import osdf_config
-from osdf.logging.osdf_logging import error_log, debug_log
+from osdf.logging.osdf_logging import debug_log
+from osdf.logging.osdf_logging import error_log
from osdf.utils.interfaces import RestClient
AUTHZ_PERMS_USER = '{}/authz/perms/user/{}'
from osdf.utils.interfaces import RestClient
AUTHZ_PERMS_USER = '{}/authz/perms/user/{}'
def remote_api(passwd, uid):
def remote_api(passwd, uid):
- headers = {"Accept": "application/Users+xml;q=1.0;charset=utf-8;version=2.0,text/xml;q=1.0;version=2.0",
- "Accept": "application/Users+json;q=1.0;charset=utf-8;version=2.0,application/json;q=1.0;version=2.0,*/*;q=1.0"}
+ headers = {"Accept": "application/Users+json;q=1.0;charset=utf-8;version=2.0,application/json;q=1.0;version=2.0,"
+ "*/*;q=1.0"}
url = AUTHZ_PERMS_USER.format(deploy_config['aaf_url'], uid)
rc = RestClient(userid=uid, passwd=passwd, headers=headers, url=url, log_func=debug_log.debug,
req_id='aaf_user_id')
url = AUTHZ_PERMS_USER.format(deploy_config['aaf_url'], uid)
rc = RestClient(userid=uid, passwd=passwd, headers=headers, url=url, log_func=debug_log.debug,
req_id='aaf_user_id')
-from requests.exceptions import HTTPError
from osdf.config.base import osdf_config
from osdf.utils.interfaces import RestClient
from osdf.config.base import osdf_config
from osdf.utils.interfaces import RestClient
return response_json.get("result")
except requests.RequestException as e:
raise DESException("Request exception was encountered {}".format(e))
return response_json.get("result")
except requests.RequestException as e:
raise DESException("Request exception was encountered {}".format(e))
- except HTTPError as ex:
- raise DESException("Response code other than 200. Response code: {}".format(ex.response.status_code))
res_code = str(res.status_code)
if not any(res_code.startswith(x) for x in map(str, ok_codes)):
res_code = str(res.status_code)
if not any(res_code.startswith(x) for x in map(str, ok_codes)):
- raise res.raise_for_status()
+ raise BaseException(res.raise_for_status())
if raw_response:
return res
if raw_response:
return res
commands = bash -c "pylint --reports=y osdf apps runtime| tee pylint.out"
[testenv:py3]
commands = bash -c "pylint --reports=y osdf apps runtime| tee pylint.out"
[testenv:py3]
whitelist_externals=bash
deps = hacking>=2.0.0
commands =
whitelist_externals=bash
deps = hacking>=2.0.0
commands =