Skip to content

Commit

Permalink
Logging level, flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ponyisi committed Nov 12, 2024
1 parent 86d0027 commit fe88aaa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions did_finder_rucio/src/rucio_did_finder/lookup_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from servicex_did_finder_lib.replica_distance_service import ReplicaSorter
import os


class LookupRequest:
def __init__(self, did: str,
rucio_adapter: RucioAdapter,
Expand All @@ -55,7 +56,7 @@ def __init__(self, did: str,
self.location = None
self.replica_sorter = None
if 'RUCIO_LATITUDE' in os.environ and 'RUCIO_LONGITUDE' in os.environ\
and 'USE_REPLICA_SORTER' in os.environ:
and 'USE_REPLICA_SORTER' in os.environ:
self.location = {'latitude': float(os.environ['RUCIO_LATITUDE']),
'longitude': float(os.environ['RUCIO_LONGITUDE'])
}
Expand All @@ -79,10 +80,10 @@ def lookup_files(self):
ds_size += af['file_size']
total_paths += len(af['paths'])
ipaths = af['paths'].copy()
self.logger.info(f'path before {ipaths}')
self.logger.debug(f'path before {ipaths}')
if self.replica_sorter is not None and self.location is not None:
af['paths'] = self.replica_sorter.sort_replicas(ipaths, self.location)
self.logger.info(f'path after {af["paths"]}')
self.logger.debug(f'path after {af["paths"]}')
full_file_list.append(af)
yield full_file_list

Expand Down

0 comments on commit fe88aaa

Please sign in to comment.