Skip to content

Commit

Permalink
Testing: Remove unnecessary str() casting; rucio#6538
Browse files Browse the repository at this point in the history
  • Loading branch information
rdimaio committed Mar 18, 2024
1 parent b9821d2 commit a322f62
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/rucio/common/utils.py
Expand Up @@ -578,7 +578,7 @@ def val_to_space_sep_str(vallist):
else:
return str(vallist)
except:
return str('')
return ''


def date_to_str(date):
Expand Down
2 changes: 1 addition & 1 deletion lib/rucio/core/replica.py
Expand Up @@ -94,7 +94,7 @@ def get_bad_replicas_summary(rse_expression=None, from_date=None, to_date=None,
rse_clause.append(models.BadReplicas.rse_id == rse['id'])

if session.bind.dialect.name == 'oracle':
to_days = func.trunc(models.BadReplicas.created_at, str('DD'))
to_days = func.trunc(models.BadReplicas.created_at, 'DD')
elif session.bind.dialect.name == 'mysql':
to_days = func.date(models.BadReplicas.created_at)
elif session.bind.dialect.name == 'postgresql':
Expand Down
4 changes: 2 additions & 2 deletions lib/rucio/daemons/conveyor/receiver.py
Expand Up @@ -70,9 +70,9 @@ def on_message(self, frame):
if 'job_metadata' in msg.keys() \
and isinstance(msg['job_metadata'], dict) \
and 'issuer' in msg['job_metadata'].keys() \
and str(msg['job_metadata']['issuer']) == str('rucio'):
and str(msg['job_metadata']['issuer']) == 'rucio':

if 'job_state' in msg.keys() and (str(msg['job_state']) != str('ACTIVE') or msg.get('job_multihop', False) is True):
if 'job_state' in msg.keys() and (str(msg['job_state']) != 'ACTIVE' or msg.get('job_multihop', False) is True):
METRICS.counter('message_rucio').inc()

self._perform_request_update(msg)
Expand Down
4 changes: 2 additions & 2 deletions lib/rucio/transfertool/fts3.py
Expand Up @@ -653,7 +653,7 @@ def __init__(self, external_host, request_id, fts_message):
self._transfer_id = fts_message.get('tr_id').split("__")[-1]

self._file_metadata = fts_message['file_metadata']
self._multi_sources = str(fts_message.get('job_metadata', {}).get('multi_sources', '')).lower() == str('true')
self._multi_sources = str(fts_message.get('job_metadata', {}).get('multi_sources', '')).lower() == 'true'
self._src_url = fts_message.get('src_url', None)
self._dst_url = fts_message.get('dst_url', None)

Expand Down Expand Up @@ -724,7 +724,7 @@ def __init__(self, external_host, request_id, job_response, file_response, reque
self._transfer_id = job_response.get('job_id')

self._file_metadata = file_response['file_metadata']
self._multi_sources = str(job_response['job_metadata'].get('multi_sources', '')).lower() == str('true')
self._multi_sources = str(job_response['job_metadata'].get('multi_sources', '')).lower() == 'true'
self._src_url = file_response.get('source_surl', None)
self._dst_url = file_response.get('dest_surl', None)
self.logger = logging.log
Expand Down

0 comments on commit a322f62

Please sign in to comment.