Skip to content

Commit

Permalink
CCDB :: add debbuging
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansev committed Mar 5, 2024
1 parent 07655a4 commit d6c2092
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions alienpy/alien.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,8 @@ def DO_ccdb_query(args: list = None) -> RET:
if do_report: query_str = f'{query_str}{"?" if "?" not in query_str else ""}report=true'
if not session_id: session_id = str(uuid.uuid1())

if DEBUG: logging.info('CCDB path: %s', query_str)

# if do_mirror: limit_results = '999999'
headers = { 'User-Agent': f'alien.py/{ALIENPY_VERSION_STR} id/{os.getlogin()}@{HOSTNAME} session/{session_id}', 'Accept': 'application/json', 'Accept-encoding': 'gzip, deflate', 'Browse-Limit': str(limit_results)}
for h_el in headers_list:
Expand All @@ -766,6 +768,8 @@ def DO_ccdb_query(args: list = None) -> RET:
return RET(1, '', f'Invalid answer (code {ccdb_query.status_code}) from query:\n{ccdb}{listing_type}{query_str}')
q_dict = ccdb_query.json()

if DEBUG: logging.info('CCDB query: %s\n', q_dict)

if do_report:
if not q_dict['objects'] and not q_dict['subfolders']:
return RET(1, '', 'Query failed, empty results! Check the validity of the query.', q_dict)
Expand Down Expand Up @@ -867,6 +871,7 @@ def get_alien_endpoint(obj: dict) -> str:
if do_download or do_mirror:
if not ALIENPY_GLOBAL_WB: ALIENPY_GLOBAL_WB = InitConnection(cmdlist_func = constructCmdList)
dest_list = [i[0] for i in dest_time_list]
if DEBUG: logging.info('CCDB download:\n%s\n%s\n', download_list, dest_list)
xrdcp_ret = DO_XrootdCp(ALIENPY_GLOBAL_WB, xrd_copy_command = ['-parent', '99', '-retry', '2'], api_src = download_list, api_dst = dest_list)

# set the time for the ccdb files
Expand Down

0 comments on commit d6c2092

Please sign in to comment.