Skip to content

Commit

Permalink
Fix f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
serfon committed Jul 19, 2024
1 parent 82856be commit a204c95
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/rucio/daemons/automatix/automatix.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def run_once(heartbeat_handler: HeartbeatHandler, inputfile: str, **_kwargs) ->
upload_client = UploadClient(client)
ret = upload_client.upload(files)
if ret == 0:
logger(logging.INFO, f"{dsn} successfully registered on {rse}")
logger(logging.INFO, "%s successfully registered on %s", dsn, rse)
METRICS.counter(name="addnewdataset.done").inc()
METRICS.counter(name="addnewfile.done").inc(nbfiles)
METRICS.timer(name='datasetinjection').observe(stopwatch.elapsed)
Expand All @@ -254,20 +254,24 @@ def run_once(heartbeat_handler: HeartbeatHandler, inputfile: str, **_kwargs) ->
logger(logging.INFO, "Error uploading files")
failures.append(rse)
except Exception as error:
logger(logging.ERROR, f"Error uploading files on {rse}: {str(error)}")
logger(logging.ERROR, "Error uploading files on %s: %s", rse, str(error))
failures.append(rse)
finally:
for physical_fname in physical_fnames:
remove(physical_fname)
rmdir(tmpdir)
logger(
logging.INFO,
f"It took {cycle_stopwatch.elapsed} seconds to upload datasets on {len(successes)} RSEs: {str(successes)}",
)
logger(
logging.INFO,
f"Datasets could not be uploaded on {len(failures)} RSEs: {str(failures)}",
"It took %f seconds to upload datasets on %s RSEs: %s",
cycle_stopwatch.elapsed,
len(successes),
str(successes),
)
if failures:
logger(
logging.WARNING,
"Datasets could not be uploaded on %s RSEs: %s", len(failures), str(failures),
)
return True


Expand Down

0 comments on commit a204c95

Please sign in to comment.