internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: rucio/rucio

Issue:
Prefer root protocol if local site has xCache
Motivation
----------
From Stéphane in [JIRA](https://its.cern.ch/jira/browse/RUCIO-2888)

> Hello,
> Currently, when a job tries to access a file through rucio mover (copy2scratch) or direct access through xcache, instead of using xcache (and maybe http), the used protocol will depend on the prefer protocol of the remote site. Could this be corrected ?
> Thanks
> Stéphane


Discussion:
After chatting with Stephane we figured out what is actually needed ;-) Since XCache supports http, we should allow xcache usage not only for root URLs but also for http URLs.
(this also means forcefully mangling our typical davs:// into https://)

Resolving patch:
diff --git a/lib/rucio/core/replica.py b/lib/rucio/core/replica.py
--- a/lib/rucio/core/replica.py
+++ b/lib/rucio/core/replica.py
@@ -952,9 +952,10 @@ def _list_replicas(dataset_clause, file_clause, state_clause, show_pfns,
                             values()[0]
 
                         # server side root proxy handling if location is set.
+                        # supports root and http destinations
                         # cannot be pushed into protocols because we need to lookup rse attributes.
                         # ultra-conservative implementation.
-                        if domain == 'wan' and protocol.attributes['scheme'] == 'root' and client_location:
+                        if domain == 'wan' and protocol.attributes['scheme'] in ['root', 'http', 'https'] and client_location:
 
                             if 'site' in client_location and client_location['site']:
 
@@ -972,7 +973,8 @@ def _list_replicas(dataset_clause, file_clause, state_clause, show_pfns,
                                                                      default='',               # empty string to circumvent exception
                                                                      session=session)
                                     if root_proxy_internal:
-                                        pfn = 'root://' + root_proxy_internal + '//' + pfn
+                                        # don't forget to mangle gfal-style davs URL into generic https URL
+                                        pfn = 'root://' + root_proxy_internal + '//' + pfn.replace('davs://', 'https://')
 
                         # do we need to sign the URLs?
                         if sign_urls and protocol.attributes['scheme'] == 'https':


Test patch:
Repository: rucio/rucio

Issue:
Do not mangle URLs when using GFAL library
Motivation
----------

From Tim:
> For the DOMA TPC work, we have added a workaround in the external gateways, so they strip leading /s in the path. I don't think we applied the same hack for access from the worker nodes. If necessary this might be possible, but would need careful testing with other VOs, so isn't something we can do trivially.
> 
> Can we fix GFAL2 to not add the extra // ? For interactive use (eg. gfal-copy) we a fix was implemented some time ago, but it requires an option to enable. I'll check the details and follow up later.

cf. https://its.cern.ch/jira/browse/ATLDDMOPS-5503



Discussion:

Resolving patch:
diff --git a/lib/rucio/rse/protocols/gfal.py b/lib/rucio/rse/protocols/gfal.py
--- a/lib/rucio/rse/protocols/gfal.py
+++ b/lib/rucio/rse/protocols/gfal.py
@@ -1,4 +1,4 @@
-# Copyright 2014-2018 CERN for the benefit of the ATLAS collaboration.
+# Copyright 2014-2019 CERN for the benefit of the ATLAS collaboration.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
 # - Wen Guan <wguan.icedew@gmail.com>, 2014-2016
 # - Vincent Garonne <vgaronne@gmail.com>, 2014-2018
 # - Cedric Serfon <cedric.serfon@cern.ch>, 2014-2016
-# - Mario Lassnig <mario.lassnig@cern.ch>, 2016-2017
+# - Mario Lassnig <mario.lassnig@cern.ch>, 2016-2019
 # - Tobias Wegner <twegner@cern.ch>, 2017
 # - Nicolo Magini <Nicolo.Magini@cern.ch>, 2018-2019
 # - Joaquin Bogado <jbogado@linti.unlp.edu.ar>, 2018
@@ -182,10 +182,9 @@ def connect(self):
         """
 
         self.__ctx = gfal2.creat_context()  # pylint: disable=no-member
-        # self.__ctx.set_opt_string("X509", "CERT", proxy)
-        # self.__ctx.set_opt_string("X509", "KEY", proxy)
         self.__ctx.set_opt_string_list("SRM PLUGIN", "TURL_PROTOCOLS", ["gsiftp", "rfio", "gsidcap", "dcap", "kdcap"])
         self.__ctx.set_opt_string("XROOTD PLUGIN", "XRD.WANTPROT", "gsi,unix")
+        self.__ctx.set_opt_boolean("XROOTD PLUGIN", "NORMALIZE_PATH", False)
 
     def get(self, path, dest, transfer_timeout=None):
         """


Test patch:
Repository: rucio/rucio

Issue:
Permission check for ddmadmin done wrong
Motivation
----------
In some of the permission checks we do
`if _is_root(issuer) or issuer == 'ddmadmin':`
which does not work anymore since we introduced the InternalAccount for the issuers.

Modification
------------
Change to
`if _is_root(issuer) or issuer.external == 'ddmadmin':`
or add ddmadmin to the `_is_root` check




Discussion:

Resolving patch:
diff --git a/lib/rucio/core/permission/atlas.py b/lib/rucio/core/permission/atlas.py
--- a/lib/rucio/core/permission/atlas.py
+++ b/lib/rucio/core/permission/atlas.py
@@ -14,7 +14,7 @@
 #
 # Authors:
 # - Vincent Garonne <vgaronne@gmail.com>, 2016
-# - Martin Barisits <martin.barisits@cern.ch>, 2016-2018
+# - Martin Barisits <martin.barisits@cern.ch>, 2016-2019
 # - Cedric Serfon <cedric.serfon@cern.ch>, 2016-2019
 # - Mario Lassnig <mario.lassnig@cern.ch>, 2018
 # - Hannes Hansen <hannes.jakob.hansen@cern.ch>, 2018-2019
@@ -115,7 +115,7 @@ def has_permission(issuer, action, kwargs):
 
 
 def _is_root(issuer):
-    return issuer.external == 'root'
+    return issuer.external == 'root' or issuer.external == 'ddmadmin'
 
 
 def perm_default(issuer, kwargs):
@@ -448,7 +448,7 @@ def perm_del_rule(issuer, kwargs):
     :param kwargs: List of arguments for the action.
     :returns: True if account is allowed to call the API call, otherwise False
     """
-    if _is_root(issuer) or issuer == 'ddmadmin':
+    if _is_root(issuer):
         return True
     if get_rule(kwargs['rule_id'])['account'] == issuer:
         return True


Test patch:
Repository: rucio/rucio

Issue:
Adapt replica creation privilege to CMS naming
Motivation
----------

From Diego: @dciangot 
Details: Account dciangot can not add file replicas on T2_IT_Legnaro_Temp

Modification
------------
Change the permission file for CMS



Discussion:

Resolving patch:
diff --git a/lib/rucio/core/permission/cms.py b/lib/rucio/core/permission/cms.py
--- a/lib/rucio/core/permission/cms.py
+++ b/lib/rucio/core/permission/cms.py
@@ -601,12 +601,9 @@ def perm_add_replicas(issuer, kwargs):
     :param kwargs: List of arguments for the action.
     :returns: True if account is allowed, otherwise False
     """
-    return (_is_root(issuer) or
-            str(kwargs.get('rse', '')).endswith('SCRATCHDISK') or
-            str(kwargs.get('rse', '')).endswith('USERDISK') or
-            str(kwargs.get('rse', '')).endswith('MOCK') or
-            str(kwargs.get('rse', '')).endswith('LOCALGROUPDISK') or
-            has_account_attribute(account=issuer, key='admin'))
+    return (_is_root(issuer)
+            or str(kwargs.get('rse', '')).endswith('_Temp')
+            or has_account_attribute(account=issuer, key='admin'))
 
 
 def perm_skip_availability_check(issuer, kwargs):


Test patch:
Repository: rucio/rucio

Issue:
session() replaced by Session() in requests
Noticed this going through the requests documentation


Discussion:

Resolving patch:
diff --git a/lib/rucio/client/baseclient.py b/lib/rucio/client/baseclient.py
--- a/lib/rucio/client/baseclient.py
+++ b/lib/rucio/client/baseclient.py
@@ -57,7 +57,7 @@
     from urllib.parse import urlparse
     from configparser import NoOptionError, NoSectionError
 from dogpile.cache import make_region
-from requests import session
+from requests import Session
 from requests.status_codes import codes, _codes
 from requests.exceptions import ConnectionError
 from requests.packages.urllib3 import disable_warnings  # pylint: disable=import-error
@@ -126,7 +126,7 @@ def __init__(self, rucio_host=None, auth_host=None, account=None, ca_cert=None,
         self.host = rucio_host
         self.list_hosts = []
         self.auth_host = auth_host
-        self.session = session()
+        self.session = Session()
         self.user_agent = "%s/%s" % (user_agent, version.version_string())  # e.g. "rucio-clients/0.2.13"
         sys.argv[0] = sys.argv[0].split('/')[-1]
         self.script_id = '::'.join(sys.argv[0:2])
@@ -315,7 +315,7 @@ def _send_request(self, url, headers=None, type='GET', data=None, params=None, s
                 continue
 
             if result is not None and result.status_code == codes.unauthorized:  # pylint: disable-msg=E1101
-                self.session = session()
+                self.session = Session()
                 self.__get_token()
                 hds['X-Rucio-Auth-Token'] = self.auth_token
             else:
diff --git a/lib/rucio/rse/protocols/webdav.py b/lib/rucio/rse/protocols/webdav.py
--- a/lib/rucio/rse/protocols/webdav.py
+++ b/lib/rucio/rse/protocols/webdav.py
@@ -190,7 +190,7 @@ def connect(self, credentials={}):
             self.timeout = credentials['timeout']
         except KeyError:
             self.timeout = 300
-        self.session = requests.session()
+        self.session = requests.Session()
         self.session.mount('https://', TLSv1HttpAdapter())
 
         # "ping" to see if the server is available


Test patch:
Repository: rucio/rucio

Issue:
Add a quota_approver similar to rule_approver
Motivation
----------
Now setting the quota is linked to the `country-xyz=admin` attribute. It would be good to have a quota_approver on the RSEs similar to rule_approver.






Discussion:

Resolving patch:
diff --git a/lib/rucio/core/permission/atlas.py b/lib/rucio/core/permission/atlas.py
--- a/lib/rucio/core/permission/atlas.py
+++ b/lib/rucio/core/permission/atlas.py
@@ -907,7 +907,11 @@ def perm_set_account_limit(issuer, kwargs):
     for kv in list_account_attributes(account=issuer):
         if kv['key'].startswith('country-') and kv['value'] == 'admin':
             admin_in_country.append(kv['key'].partition('-')[2])
-    if admin_in_country and list_rse_attributes(rse_id=kwargs['rse_id']).get('country') in admin_in_country:
+    rse_attr = list_rse_attributes(rse_id=kwargs['rse_id'])
+    if admin_in_country and rse_attr.get('country') in admin_in_country:
+        return True
+    quota_approvers = rse_attr.get('quota_approvers', None)
+    if quota_approvers and issuer.external in quota_approvers.split(','):
         return True
     return False
 
@@ -927,7 +931,11 @@ def perm_delete_account_limit(issuer, kwargs):
     for kv in list_account_attributes(account=issuer):
         if kv['key'].startswith('country-') and kv['value'] == 'admin':
             admin_in_country.append(kv['key'].partition('-')[2])
-    if admin_in_country and list_rse_attributes(rse_id=kwargs['rse_id']).get('country') in admin_in_country:
+    rse_attr = list_rse_attributes(rse_id=kwargs['rse_id'])
+    if admin_in_country and rse_attr.get('country') in admin_in_country:
+        return True
+    quota_approvers = rse_attr.get('quota_approvers', None)
+    if quota_approvers and issuer.external in quota_approvers.split(','):
         return True
     return False
 


Test patch:
Repository: rucio/rucio

Issue:
Minor improvements to MultiHop algorithm
Motivation
----------
Some minor improvements for multi-hop algorithm identified during testing.




Discussion:

Resolving patch:
diff --git a/lib/rucio/core/config.py b/lib/rucio/core/config.py
--- a/lib/rucio/core/config.py
+++ b/lib/rucio/core/config.py
@@ -165,6 +165,7 @@ def get(section, option, default=None, use_cache=True, expiration_time=3600, ses
             raise ConfigNotFound
         else:
             value = default
+            write_to_cache(value_key, str(value))  # Also write default to cache
     else:
         value = __convert_type(value)
     return value
diff --git a/lib/rucio/core/transfer.py b/lib/rucio/core/transfer.py
--- a/lib/rucio/core/transfer.py
+++ b/lib/rucio/core/transfer.py
@@ -41,6 +41,7 @@
 from rucio.common.utils import construct_surl
 from rucio.common.constants import SUPPORTED_PROTOCOLS
 from rucio.core import did, message as message_core, request as request_core
+from rucio.core.config import get as core_config_get
 from rucio.core.monitor import record_counter, record_timer
 from rucio.core.replica import add_replicas
 from rucio.core.request import queue_requests, set_requests_state
@@ -441,7 +442,7 @@ def update_transfer_state(external_host, transfer_id, state, logging_prepend_str
 
 
 @transactional_session
-def get_hops(source_rse_id, dest_rse_id, include_multihop=True, session=None):
+def get_hops(source_rse_id, dest_rse_id, include_multihop=False, session=None):
     """
     Get a list of hops needed to transfer date from source_rse_id to dest_rse_id.
     Ideally, the list will only include one item (dest_rse_id) since no hops are needed.
@@ -486,7 +487,7 @@ def get_hops(source_rse_id, dest_rse_id, include_multihop=True, session=None):
         raise NoDistance()
 
     # 2. There is no connection or no scheme match --> Try a multi hop --> Dijkstra algorithm
-    HOP_PENALTY = 5  # Penalty to be applied to each further hop
+    HOP_PENALTY = core_config_get('transfers', 'hop_penalty', default=5, session=session)  # Penalty to be applied to each further hop
 
     visited_nodes = {source_rse_id: {'distance': 0,
                                      'path': []}}  # Dijkstra already visisted nodes
@@ -628,7 +629,7 @@ def get_transfer_requests_and_source_replicas(total_workers=0, worker_number=0,
         # In case of non-connected, the list contains all the intermediary RSEs
         list_hops = []
         try:
-            list_hops = get_hops(source_rse_id, dest_rse_id, session=session)
+            list_hops = get_hops(source_rse_id, dest_rse_id, include_multihop=core_config_get('transfers', 'use_multihop', default=False, expiration_time=600, session=session), session=session)
             if len(list_hops) > 1:
                 multihop = True
                 multi_hop_dict[req_id] = (list_hops, dict_attributes, retry_count)


Test patch:
Repository: rucio/rucio

Issue:
delete_replica query on archive_contents uses too many bind variables
Motivation
----------
In the `delete_replicas` method the archive_contents clause uses too many bind variables (700).


Modification
------------
Reduce the chunking from `100` to `30`




Discussion:

Resolving patch:
diff --git a/lib/rucio/core/replica.py b/lib/rucio/core/replica.py
--- a/lib/rucio/core/replica.py
+++ b/lib/rucio/core/replica.py
@@ -1545,7 +1545,7 @@ def delete_replicas(rse_id, files, ignore_availability=True, session=None):
                                      models.DataIdentifier.name == name))
 
     # Remove Archive Constituents
-    for chunk in chunks(archive_contents_condition, 100):
+    for chunk in chunks(archive_contents_condition, 30):
         session.query(models.ConstituentAssociation).\
             with_hint(models.ConstituentAssociation, "INDEX(ARCHIVE_CONTENTS ARCH_CONTENTS_CHILD_IDX)", 'oracle').\
             filter(or_(*chunk)).\


Test patch:
Repository: rucio/rucio

Issue:
Tunable values for max_threads by host
Motivation
----------
Tunable values for max_threads by host + prevent starting new threads in case there is not enough work






Discussion:

Resolving patch:
diff --git a/lib/rucio/vcsversion.py b/lib/rucio/vcsversion.py
--- a/lib/rucio/vcsversion.py
+++ b/lib/rucio/vcsversion.py
@@ -4,8 +4,8 @@
 '''
 VERSION_INFO = {
     'final': True,
-    'version': '1.21.0rc3',
-    'branch_nick': 'feature-0-Release__1_21_0rc3_preparation',
-    'revision_id': '4424f78da3ee49c3f8cf556c4902e86d0ad0cec2',
-    'revno': 8996
+    'version': '1.21.0',
+    'branch_nick': 'patch-0-Release__1_21_0_preparation',
+    'revision_id': '7e32dee2c3af1fd51417481483449ca3d9c3bf28',
+    'revno': 9000
 }


Test patch:
Repository: rucio/rucio

Issue:
Output formatting typo in `rse/protocols/gfal.py`
 ##Motivation
----------
Previous PR #2555 introduced this bug related to a missing parentheses at the formatting of a debug output string here: https://github.com/rucio/rucio/blob/916987976a1f994a64e4ef3dce837b49141a8f1b/lib/rucio/rse/protocols/gfal.py#L363.


Modification
------------
Add the parentheses surrounding the formatting elements.




Discussion:

Resolving patch:
diff --git a/lib/rucio/rse/protocols/gfal.py b/lib/rucio/rse/protocols/gfal.py
--- a/lib/rucio/rse/protocols/gfal.py
+++ b/lib/rucio/rse/protocols/gfal.py
@@ -360,7 +360,7 @@ def stat(self, path):
                 ret[checksum_name] = ctx.checksum(str(path), str(checksum_name.capitalize()))
                 verified = True
             except Exception as error:
-                message += 'Error while processing gfal checksum call (%s). Error: %s \n' % checksum_name, str(error)
+                message += 'Error while processing gfal checksum call (%s). Error: %s \n' % (checksum_name, str(error))
 
         if not verified:
             raise exception.RSEChecksumUnavailable(message)


Test patch:
Repository: rucio/rucio

Issue:
Broken backwards compatibility for account usage and limits
Motivation
----------
Due to the change from simple limits/usage to local/global usage and limits, the backwards compatibility for old clients is currently broken. This is due to the fact that the REST endpoints where changed from
```
    '/(.+)/limits', 'AccountLimits',
    '/(.+)/limits/(.+)', 'AccountLimits',
    '/(.+)/usage/', 'Usage1',
    '/(.+)/usage/(.+)', 'Usage2',
```
to
```
    '/(.+)/limits/local', 'LocalAccountLimits',
    '/(.+)/limits/local/(.+)', 'LocalAccountLimits',
    '/(.+)/limits/global', 'GlobalAccountLimits',
    '/(.+)/limits/global/(.+)', 'GlobalAccountLimits',
```
thus the required endpoints are missing for old clients. 

Modification
------------
The endpoints need to be re-added and pointing to the local version of the usage/limit.



Discussion:

Resolving patch:
diff --git a/lib/rucio/web/rest/webpy/v1/account.py b/lib/rucio/web/rest/webpy/v1/account.py
--- a/lib/rucio/web/rest/webpy/v1/account.py
+++ b/lib/rucio/web/rest/webpy/v1/account.py
@@ -61,12 +61,16 @@
     '/(.+)/limits/local/(.+)', 'LocalAccountLimits',
     '/(.+)/limits/global', 'GlobalAccountLimits',
     '/(.+)/limits/global/(.+)', 'GlobalAccountLimits',
+    '/(.+)/limits', 'LocalAccountLimits',
+    '/(.+)/limits/(.+)', 'LocalAccountLimits',
     '/(.+)/rules', 'Rules',
     '/(.+)/usage/history/(.+)', 'UsageHistory',
     '/(.+)/usage/local', 'LocalUsage',
     '/(.+)/usage/local/(.+)', 'LocalUsage',
     '/(.+)/usage/global', 'GlobalUsage',
     '/(.+)/usage/global/(.+)', 'GlobalUsage',
+    '/(.+)/usage', 'LocalUsage',
+    '/(.+)/usage/(.+)', 'LocalUsage',
     '/(.+)', 'AccountParameter',
     '/?$', 'Account',
 )


Test patch:
Repository: rucio/rucio

Issue:
Backwards compatibility for account usage and limits broken
Motivation
----------
The 1.21 release introduced local and global quotas and broke backwards compatibility to the old clients.




Discussion:

Resolving patch:
diff --git a/lib/rucio/daemons/conveyor/finisher.py b/lib/rucio/daemons/conveyor/finisher.py
--- a/lib/rucio/daemons/conveyor/finisher.py
+++ b/lib/rucio/daemons/conveyor/finisher.py
@@ -408,7 +408,7 @@ def __update_bulk_replicas(replicas, session=None):
     :returns commit_or_rollback:  Boolean.
     """
     try:
-        replica_core.update_replicas_states(replicas, nowait=True, add_tombstone=True, session=session)
+        replica_core.update_replicas_states(replicas, nowait=True, add_tombstone=False, session=session)  # TODO: add_tombstone needs to be changed to True once set_tombstone is fixed
     except ReplicaNotFound as error:
         logging.warn('Failed to bulk update replicas, will do it one by one: %s', str(error))
         raise ReplicaNotFound(error)
@@ -432,7 +432,7 @@ def __update_replica(replica, session=None):
     """
 
     try:
-        replica_core.update_replicas_states([replica], nowait=True, add_tombstone=True, session=session)
+        replica_core.update_replicas_states([replica], nowait=True, add_tombstone=False, session=session)  # TODO: add_tombstone needs to be changed to True once set_tombstone is fixed
         if not replica['archived']:
             request_core.archive_request(replica['request_id'], session=session)
         logging.info("HANDLED REQUEST %s DID %s:%s AT RSE %s STATE %s", replica['request_id'], replica['scope'], replica['name'], replica['rse_id'], str(replica['state']))
diff --git a/lib/rucio/web/rest/webpy/v1/account.py b/lib/rucio/web/rest/webpy/v1/account.py
--- a/lib/rucio/web/rest/webpy/v1/account.py
+++ b/lib/rucio/web/rest/webpy/v1/account.py
@@ -69,7 +69,7 @@
     '/(.+)/usage/local/(.+)', 'LocalUsage',
     '/(.+)/usage/global', 'GlobalUsage',
     '/(.+)/usage/global/(.+)', 'GlobalUsage',
-    '/(.+)/usage', 'LocalUsage',
+    '/(.+)/usage/', 'LocalUsage',
     '/(.+)/usage/(.+)', 'LocalUsage',
     '/(.+)', 'AccountParameter',
     '/?$', 'Account',
diff --git a/lib/rucio/web/rest/webpy/v1/account_limit.py b/lib/rucio/web/rest/webpy/v1/account_limit.py
--- a/lib/rucio/web/rest/webpy/v1/account_limit.py
+++ b/lib/rucio/web/rest/webpy/v1/account_limit.py
@@ -14,7 +14,7 @@
 # limitations under the License.
 #
 # Authors:
-# - Martin Barisits <martin.barisits@cern.ch>, 2014
+# - Martin Barisits <martin.barisits@cern.ch>, 2014-2019
 # - Vincent Garonne <vincent.garonne@cern.ch>, 2017
 # - Mario Lassnig <mario.lassnig@cern.ch>, 2018
 # - Hannes Hansen <hannes.jakob.hansen@cern.ch>, 2018-2019
@@ -41,6 +41,7 @@
 URLS = (
     '/local/(.+)/(.+)', 'LocalAccountLimit',
     '/global/(.+)/(.+)', 'GlobalAccountLimit',
+    '/(.+)/(.+)', 'LocalAccountLimit',
 )
 
 


Test patch:
Repository: rucio/rucio

Issue:
Backwards compatibility for account usage and limits broken
Motivation
----------
The 1.21 release introduced local and global quotas and broke backwards compatibility to the old clients.




Discussion:

Resolving patch:
diff --git a/lib/rucio/vcsversion.py b/lib/rucio/vcsversion.py
--- a/lib/rucio/vcsversion.py
+++ b/lib/rucio/vcsversion.py
@@ -4,8 +4,8 @@
 '''
 VERSION_INFO = {
     'final': True,
-    'version': '1.21.1',
-    'branch_nick': 'patch-0-Release__1_21_1_prep',
-    'revision_id': 'c2e73d4a4c5583d195a6bc78ecf41fc79f9a8d67',
-    'revno': 9025
+    'version': '1.21.2',
+    'branch_nick': 'patch-0-Release__1_21_2_preparation',
+    'revision_id': 'bc92f48c2ddd2c3f571fe80e9be647f5d21989bf',
+    'revno': 9029
 }


Test patch:
Repository: rucio/rucio

Issue:
Move to snake_case for RSE attributes for total and used space
Motivation
----------

After discussion, it looks like many people prefer snake_case instead of CamelCase for RSE attributes for total and used space. That's obviously a wrong choice similar to choosing emacs instead of vi (my 2 satoshis), but since the majority decides, let it be...





Discussion:

Resolving patch:
diff --git a/lib/rucio/daemons/reaper/reaper2.py b/lib/rucio/daemons/reaper/reaper2.py
--- a/lib/rucio/daemons/reaper/reaper2.py
+++ b/lib/rucio/daemons/reaper/reaper2.py
@@ -276,8 +276,8 @@ def __check_rse_usage(rse, rse_id, prepend_str):
 
         # Check from which sources to get used and total spaces
         # Default is storage
-        source_for_total_space = attributes.get('sourceForTotalSpace', 'storage')
-        source_for_used_space = attributes.get('sourceForUsedSpace', 'storage')
+        source_for_total_space = attributes.get('source_for_total_space', 'storage')
+        source_for_used_space = attributes.get('source_for_used_space', 'storage')
 
         logging.debug('%s RSE: %s, source_for_total_space: %s, source_for_used_space: %s',
                       prepend_str, rse, source_for_total_space, source_for_used_space)


Test patch: