Dark Reaper rse_id crash
Motivation
----------
The dark reaper raises an error in 1.20.3


Modification
------------
Fix the query in core/quarantined_replica.py -> list_rses()


diff --git a/lib/rucio/core/quarantined_replica.py b/lib/rucio/core/quarantined_replica.py
index 749ae77cb..29f52e067 100644
--- a/lib/rucio/core/quarantined_replica.py
+++ b/lib/rucio/core/quarantined_replica.py
@@ -161,7 +161,7 @@ def list_rses(session=None):
 
     :returns: a list of RSEs.
     """
-    query = session.query(models.RSE.rse_id).distinct(models.RSE.rse_id).\\
+    query = session.query(models.RSE.id).distinct(models.RSE.id).\\
         filter(models.QuarantinedReplica.rse_id == models.RSE.id).\\
         filter(models.RSE.deleted == false())
     return [rse for (rse,) in query]
diff --git a/lib/rucio/rse/protocols/gfal.py b/lib/rucio/rse/protocols/gfal.py
index c2a835b8b..d8056e4d7 100644
--- a/lib/rucio/rse/protocols/gfal.py
+++ b/lib/rucio/rse/protocols/gfal.py
@@ -394,7 +394,7 @@ class Default(protocol.RSEProtocol):
             params.timeout = int(transfer_timeout)
             watchdog = Timer(params.timeout + 60, self.__gfal2_cancel)
 
-        if not self.renaming and dest[:5] == 'https':
+        if not (self.renaming and dest[:5] == 'https'):
             dir_name = os.path.dirname(dest)
             # This function will be removed soon. gfal2 will create parent dir automatically.
             try:
['lib/rucio/rse/protocols/gfal.py', 'lib/rucio/core/quarantined_replica.py']