dmwm / dmwm/CRABClient

resolve code duplication and unify handling of things/errors in curl use

Open
#5,083 0 comments 0 reactions 1 assignee Claimed by @ddaina View on GitHub
enhancement MediumPrio Py2/3
Dominant language
Python
Stars
18
Forks
38
PR merge metrics
No merged PRs in 30d

Description

Currently in CRABClient we have following places were we form `curl` requests:

1. `makeRequest` in `CrabRestInterface.py`: https://github.com/dmwm/CRABClient/blob/master/src/python/CRABClient/CrabRestInterface.py#L146-#L183
1. `getUsernameFromCRIC` in `UserUtilities.py`: https://github.com/dmwm/CRABClient/blob/master/src/python/CRABClient/UserUtilities.py#L80-#L89
1. `curlGetFileFromURL` in `UserUtilities.py`: https://github.com/dmwm/CRABClient/blob/master/src/python/CRABClient/UserUtilities.py#L106-#L137

code above relies on [`execute_command`](https://github.com/dmwm/CRABClient/blob/master/src/python/CRABClient/ClientUtilities.py#L765) implementation to actually execute command.

there are 2 main problems with code listed above and code which uses those functions:
1. First of all, the way requests are formed is not unified;
1. Secondly, error handling is not unified and in some places ignored at all; there is a code duplication.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.