rucio 35.7.0__py3-none-any.whl → 37.0.0rc2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rucio might be problematic. Click here for more details.

Files changed (268) hide show
  1. rucio/alembicrevision.py +1 -1
  2. rucio/{daemons/c3po/collectors → cli}/__init__.py +1 -0
  3. rucio/cli/account.py +216 -0
  4. rucio-35.7.0.data/scripts/rucio → rucio/cli/bin_legacy/rucio.py +769 -486
  5. rucio-35.7.0.data/scripts/rucio-admin → rucio/cli/bin_legacy/rucio_admin.py +476 -423
  6. rucio/cli/command.py +272 -0
  7. rucio/cli/config.py +72 -0
  8. rucio/cli/did.py +191 -0
  9. rucio/cli/download.py +128 -0
  10. rucio/cli/lifetime_exception.py +33 -0
  11. rucio/cli/replica.py +162 -0
  12. rucio/cli/rse.py +293 -0
  13. rucio/cli/rule.py +158 -0
  14. rucio/cli/scope.py +40 -0
  15. rucio/cli/subscription.py +73 -0
  16. rucio/cli/upload.py +60 -0
  17. rucio/cli/utils.py +226 -0
  18. rucio/client/accountclient.py +0 -1
  19. rucio/client/baseclient.py +33 -24
  20. rucio/client/client.py +45 -1
  21. rucio/client/didclient.py +5 -3
  22. rucio/client/downloadclient.py +6 -8
  23. rucio/client/replicaclient.py +0 -2
  24. rucio/client/richclient.py +317 -0
  25. rucio/client/rseclient.py +4 -4
  26. rucio/client/uploadclient.py +26 -12
  27. rucio/common/bittorrent.py +234 -0
  28. rucio/common/cache.py +66 -29
  29. rucio/common/checksum.py +168 -0
  30. rucio/common/client.py +122 -0
  31. rucio/common/config.py +22 -35
  32. rucio/common/constants.py +61 -3
  33. rucio/common/didtype.py +72 -24
  34. rucio/common/dumper/__init__.py +45 -38
  35. rucio/common/dumper/consistency.py +75 -30
  36. rucio/common/dumper/data_models.py +63 -19
  37. rucio/common/dumper/path_parsing.py +19 -8
  38. rucio/common/exception.py +65 -8
  39. rucio/common/extra.py +5 -10
  40. rucio/common/logging.py +13 -13
  41. rucio/common/pcache.py +8 -7
  42. rucio/common/plugins.py +59 -27
  43. rucio/common/policy.py +12 -3
  44. rucio/common/schema/__init__.py +84 -34
  45. rucio/common/schema/generic.py +0 -17
  46. rucio/common/schema/generic_multi_vo.py +0 -17
  47. rucio/common/stomp_utils.py +383 -119
  48. rucio/common/test_rucio_server.py +12 -6
  49. rucio/common/types.py +132 -52
  50. rucio/common/utils.py +93 -643
  51. rucio/core/account_limit.py +14 -12
  52. rucio/core/authentication.py +2 -2
  53. rucio/core/config.py +23 -42
  54. rucio/core/credential.py +14 -15
  55. rucio/core/did.py +5 -1
  56. rucio/core/did_meta_plugins/elasticsearch_meta.py +407 -0
  57. rucio/core/did_meta_plugins/filter_engine.py +62 -3
  58. rucio/core/did_meta_plugins/json_meta.py +2 -2
  59. rucio/core/did_meta_plugins/mongo_meta.py +43 -30
  60. rucio/core/did_meta_plugins/postgres_meta.py +75 -39
  61. rucio/core/identity.py +6 -5
  62. rucio/core/importer.py +4 -3
  63. rucio/core/lifetime_exception.py +2 -2
  64. rucio/core/lock.py +8 -7
  65. rucio/core/message.py +6 -0
  66. rucio/core/monitor.py +30 -29
  67. rucio/core/naming_convention.py +2 -2
  68. rucio/core/nongrid_trace.py +2 -2
  69. rucio/core/oidc.py +11 -9
  70. rucio/core/permission/__init__.py +79 -37
  71. rucio/core/permission/generic.py +1 -7
  72. rucio/core/permission/generic_multi_vo.py +1 -7
  73. rucio/core/quarantined_replica.py +4 -3
  74. rucio/core/replica.py +464 -139
  75. rucio/core/replica_sorter.py +55 -59
  76. rucio/core/request.py +34 -32
  77. rucio/core/rse.py +301 -97
  78. rucio/core/rse_counter.py +1 -2
  79. rucio/core/rse_expression_parser.py +7 -7
  80. rucio/core/rse_selector.py +9 -7
  81. rucio/core/rule.py +41 -40
  82. rucio/core/rule_grouping.py +42 -40
  83. rucio/core/scope.py +5 -4
  84. rucio/core/subscription.py +26 -28
  85. rucio/core/topology.py +11 -11
  86. rucio/core/trace.py +2 -2
  87. rucio/core/transfer.py +29 -15
  88. rucio/core/volatile_replica.py +4 -3
  89. rucio/daemons/atropos/atropos.py +1 -1
  90. rucio/daemons/auditor/__init__.py +2 -2
  91. rucio/daemons/auditor/srmdumps.py +6 -6
  92. rucio/daemons/automatix/automatix.py +32 -21
  93. rucio/daemons/badreplicas/necromancer.py +2 -2
  94. rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
  95. rucio/daemons/bb8/t2_background_rebalance.py +1 -1
  96. rucio/daemons/cache/consumer.py +26 -90
  97. rucio/daemons/common.py +15 -25
  98. rucio/daemons/conveyor/finisher.py +2 -2
  99. rucio/daemons/conveyor/poller.py +18 -28
  100. rucio/daemons/conveyor/receiver.py +53 -123
  101. rucio/daemons/conveyor/stager.py +1 -0
  102. rucio/daemons/conveyor/submitter.py +3 -3
  103. rucio/daemons/hermes/hermes.py +129 -369
  104. rucio/daemons/judge/evaluator.py +2 -2
  105. rucio/daemons/oauthmanager/oauthmanager.py +3 -3
  106. rucio/daemons/reaper/dark_reaper.py +7 -3
  107. rucio/daemons/reaper/reaper.py +12 -16
  108. rucio/daemons/rsedecommissioner/config.py +1 -1
  109. rucio/daemons/rsedecommissioner/profiles/generic.py +5 -4
  110. rucio/daemons/rsedecommissioner/profiles/types.py +7 -6
  111. rucio/daemons/rsedecommissioner/rse_decommissioner.py +1 -1
  112. rucio/daemons/storage/consistency/actions.py +8 -6
  113. rucio/daemons/tracer/kronos.py +117 -142
  114. rucio/db/sqla/constants.py +5 -0
  115. rucio/db/sqla/migrate_repo/versions/1677d4d803c8_split_rse_availability_into_multiple.py +4 -4
  116. rucio/db/sqla/migrate_repo/versions/30d5206e9cad_increase_oauthrequest_redirect_msg_.py +37 -0
  117. rucio/db/sqla/models.py +157 -154
  118. rucio/db/sqla/session.py +58 -27
  119. rucio/db/sqla/types.py +2 -2
  120. rucio/db/sqla/util.py +2 -2
  121. rucio/gateway/account.py +18 -12
  122. rucio/gateway/account_limit.py +137 -60
  123. rucio/gateway/authentication.py +18 -12
  124. rucio/gateway/config.py +30 -20
  125. rucio/gateway/credential.py +9 -10
  126. rucio/gateway/did.py +70 -53
  127. rucio/gateway/dirac.py +6 -4
  128. rucio/gateway/exporter.py +3 -2
  129. rucio/gateway/heartbeat.py +6 -4
  130. rucio/gateway/identity.py +36 -51
  131. rucio/gateway/importer.py +3 -2
  132. rucio/gateway/lifetime_exception.py +3 -2
  133. rucio/gateway/meta_conventions.py +17 -6
  134. rucio/gateway/permission.py +4 -1
  135. rucio/gateway/quarantined_replica.py +3 -2
  136. rucio/gateway/replica.py +31 -22
  137. rucio/gateway/request.py +27 -18
  138. rucio/gateway/rse.py +69 -37
  139. rucio/gateway/rule.py +46 -26
  140. rucio/gateway/scope.py +3 -2
  141. rucio/gateway/subscription.py +14 -11
  142. rucio/gateway/vo.py +12 -8
  143. rucio/rse/__init__.py +3 -3
  144. rucio/rse/protocols/bittorrent.py +11 -1
  145. rucio/rse/protocols/cache.py +0 -11
  146. rucio/rse/protocols/dummy.py +0 -11
  147. rucio/rse/protocols/gfal.py +14 -9
  148. rucio/rse/protocols/globus.py +1 -1
  149. rucio/rse/protocols/http_cache.py +1 -1
  150. rucio/rse/protocols/posix.py +2 -2
  151. rucio/rse/protocols/protocol.py +84 -317
  152. rucio/rse/protocols/rclone.py +2 -1
  153. rucio/rse/protocols/rfio.py +10 -1
  154. rucio/rse/protocols/ssh.py +2 -1
  155. rucio/rse/protocols/storm.py +2 -13
  156. rucio/rse/protocols/webdav.py +74 -30
  157. rucio/rse/protocols/xrootd.py +2 -1
  158. rucio/rse/rsemanager.py +170 -53
  159. rucio/rse/translation.py +260 -0
  160. rucio/tests/common.py +23 -13
  161. rucio/tests/common_server.py +26 -9
  162. rucio/transfertool/bittorrent.py +15 -14
  163. rucio/transfertool/bittorrent_driver.py +5 -7
  164. rucio/transfertool/bittorrent_driver_qbittorrent.py +9 -8
  165. rucio/transfertool/fts3.py +20 -16
  166. rucio/transfertool/mock.py +2 -3
  167. rucio/vcsversion.py +4 -4
  168. rucio/version.py +7 -0
  169. rucio/web/rest/flaskapi/v1/accounts.py +17 -3
  170. rucio/web/rest/flaskapi/v1/auth.py +5 -5
  171. rucio/web/rest/flaskapi/v1/credentials.py +3 -2
  172. rucio/web/rest/flaskapi/v1/dids.py +21 -15
  173. rucio/web/rest/flaskapi/v1/identities.py +33 -9
  174. rucio/web/rest/flaskapi/v1/redirect.py +5 -4
  175. rucio/web/rest/flaskapi/v1/replicas.py +12 -8
  176. rucio/web/rest/flaskapi/v1/rses.py +15 -4
  177. rucio/web/rest/flaskapi/v1/traces.py +56 -19
  178. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/alembic.ini.template +1 -1
  179. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/alembic_offline.ini.template +1 -1
  180. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rucio.cfg.atlas.client.template +3 -2
  181. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rucio.cfg.template +3 -19
  182. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rucio_multi_vo.cfg.template +1 -18
  183. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/requirements.server.txt +97 -68
  184. rucio-37.0.0rc2.data/scripts/rucio +133 -0
  185. rucio-37.0.0rc2.data/scripts/rucio-admin +97 -0
  186. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-atropos +2 -2
  187. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-auditor +2 -1
  188. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-automatix +2 -2
  189. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-cache-client +17 -10
  190. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-receiver +1 -0
  191. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-kronos +1 -0
  192. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-minos +2 -2
  193. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-minos-temporary-expiration +2 -2
  194. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-necromancer +2 -2
  195. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-reaper +6 -6
  196. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-transmogrifier +2 -2
  197. rucio-37.0.0rc2.dist-info/METADATA +92 -0
  198. {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/RECORD +239 -245
  199. {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/licenses/AUTHORS.rst +3 -0
  200. rucio/common/schema/atlas.py +0 -413
  201. rucio/common/schema/belleii.py +0 -408
  202. rucio/common/schema/domatpc.py +0 -401
  203. rucio/common/schema/escape.py +0 -426
  204. rucio/common/schema/icecube.py +0 -406
  205. rucio/core/permission/atlas.py +0 -1348
  206. rucio/core/permission/belleii.py +0 -1077
  207. rucio/core/permission/escape.py +0 -1078
  208. rucio/daemons/c3po/algorithms/__init__.py +0 -13
  209. rucio/daemons/c3po/algorithms/simple.py +0 -134
  210. rucio/daemons/c3po/algorithms/t2_free_space.py +0 -128
  211. rucio/daemons/c3po/algorithms/t2_free_space_only_pop.py +0 -130
  212. rucio/daemons/c3po/algorithms/t2_free_space_only_pop_with_network.py +0 -294
  213. rucio/daemons/c3po/c3po.py +0 -371
  214. rucio/daemons/c3po/collectors/agis.py +0 -108
  215. rucio/daemons/c3po/collectors/free_space.py +0 -81
  216. rucio/daemons/c3po/collectors/jedi_did.py +0 -57
  217. rucio/daemons/c3po/collectors/mock_did.py +0 -51
  218. rucio/daemons/c3po/collectors/network_metrics.py +0 -71
  219. rucio/daemons/c3po/collectors/workload.py +0 -112
  220. rucio/daemons/c3po/utils/__init__.py +0 -13
  221. rucio/daemons/c3po/utils/dataset_cache.py +0 -50
  222. rucio/daemons/c3po/utils/expiring_dataset_cache.py +0 -56
  223. rucio/daemons/c3po/utils/expiring_list.py +0 -62
  224. rucio/daemons/c3po/utils/popularity.py +0 -85
  225. rucio/daemons/c3po/utils/timeseries.py +0 -89
  226. rucio/rse/protocols/gsiftp.py +0 -92
  227. rucio-35.7.0.data/scripts/rucio-c3po +0 -85
  228. rucio-35.7.0.dist-info/METADATA +0 -72
  229. /rucio/{daemons/c3po → cli/bin_legacy}/__init__.py +0 -0
  230. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/globus-config.yml.template +0 -0
  231. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/ldap.cfg.template +0 -0
  232. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
  233. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
  234. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
  235. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
  236. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
  237. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
  238. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
  239. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/tools/bootstrap.py +0 -0
  240. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
  241. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/data/rucio/tools/reset_database.py +0 -0
  242. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-abacus-account +0 -0
  243. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-abacus-collection-replica +0 -0
  244. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-abacus-rse +0 -0
  245. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-bb8 +0 -0
  246. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-cache-consumer +0 -0
  247. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-finisher +0 -0
  248. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-poller +0 -0
  249. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-preparer +0 -0
  250. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-stager +0 -0
  251. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-submitter +0 -0
  252. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-conveyor-throttler +0 -0
  253. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-dark-reaper +0 -0
  254. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-dumper +0 -0
  255. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-follower +0 -0
  256. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-hermes +0 -0
  257. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-cleaner +0 -0
  258. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-evaluator +0 -0
  259. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-injector +0 -0
  260. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-judge-repairer +0 -0
  261. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-oauth-manager +0 -0
  262. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-replica-recoverer +0 -0
  263. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-rse-decommissioner +0 -0
  264. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-storage-consistency-actions +0 -0
  265. {rucio-35.7.0.data → rucio-37.0.0rc2.data}/scripts/rucio-undertaker +0 -0
  266. {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/WHEEL +0 -0
  267. {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/licenses/LICENSE +0 -0
  268. {rucio-35.7.0.dist-info → rucio-37.0.0rc2.dist-info}/top_level.txt +0 -0
@@ -12,9 +12,9 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- '''
15
+ """
16
16
  Reaper is a daemon to manage file deletion.
17
- '''
17
+ """
18
18
 
19
19
  import concurrent.futures.thread # noqa (https://github.com/rucio/rucio/issues/6548)
20
20
 
@@ -33,7 +33,7 @@ from dogpile.cache.api import NoValue
33
33
  from sqlalchemy.exc import DatabaseError, IntegrityError
34
34
 
35
35
  import rucio.db.sqla.util
36
- from rucio.common.cache import make_region_memcached
36
+ from rucio.common.cache import MemcacheRegion
37
37
  from rucio.common.config import config_get_bool, config_get_int
38
38
  from rucio.common.constants import RseAttr
39
39
  from rucio.common.exception import DatabaseException, ReplicaNotFound, ReplicaUnAvailable, ResourceTemporaryUnavailable, RSEAccessDenied, RSENotFound, RSEProtocolNotSupported, ServiceUnavailable, SourceNotFound, VONotFound
@@ -57,12 +57,12 @@ if TYPE_CHECKING:
57
57
  from collections.abc import Iterable, Sequence
58
58
  from types import FrameType
59
59
 
60
- from rucio.common.types import LoggerFunction
60
+ from rucio.common.types import LFNDict, LoggerFunction
61
61
  from rucio.daemons.common import HeartbeatHandler
62
62
 
63
63
  GRACEFUL_STOP = threading.Event()
64
64
  METRICS = MetricManager(module=__name__)
65
- REGION = make_region_memcached(expiration_time=600)
65
+ REGION = MemcacheRegion(expiration_time=600)
66
66
  DAEMON_NAME = 'reaper'
67
67
 
68
68
  EXCLUDED_RSE_GAUGE = METRICS.gauge('excluded_rses.{rse}', documentation='Temporarly excluded RSEs')
@@ -474,7 +474,7 @@ def run_once(
474
474
 
475
475
  rses_to_process = get_rses_to_process(rses, include_rses, exclude_rses, vos)
476
476
  if not rses_to_process:
477
- logger(logging.ERROR, 'Reaper: No RSEs found. Will sleep for 30 seconds')
477
+ logger(logging.WARNING, 'Reaper: No RSEs found, sleeping')
478
478
  return must_sleep
479
479
  else:
480
480
  rses_to_process = [RseData(id_=rse['id'], name=rse['rse'], columns=rse) for rse in rses_to_process]
@@ -632,8 +632,13 @@ def _run_once(
632
632
  del_start_time = time.time()
633
633
  for replica in file_replicas:
634
634
  try:
635
+ lfn: "LFNDict" = {
636
+ 'scope': replica['scope'].external,
637
+ 'name': replica['name'],
638
+ 'path': replica['path']
639
+ }
635
640
  replica['pfn'] = str(list(rsemgr.lfns2pfns(rse_settings=rse.info,
636
- lfns=[{'scope': replica['scope'].external, 'name': replica['name'], 'path': replica['path']}],
641
+ lfns=[lfn],
637
642
  operation='delete', scheme=scheme).values())[0])
638
643
  except (ReplicaUnAvailable, ReplicaNotFound) as error:
639
644
  logger(logging.WARNING, 'Failed get pfn UNAVAILABLE replica %s:%s on %s with error %s', replica['scope'], replica['name'], rse.name, str(error))
@@ -690,7 +695,6 @@ def run(
690
695
 
691
696
  :param threads: The total number of workers.
692
697
  :param chunk_size: The size of chunk for deletion.
693
- :param threads_per_worker: Total number of threads created by each worker.
694
698
  :param once: If True, only runs one iteration of the main loop.
695
699
  :param greedy: If True, delete right away replicas with tombstone.
696
700
  :param rses: List of RSEs the reaper should work against.
@@ -711,14 +715,6 @@ def run(
711
715
  if rucio.db.sqla.util.is_old_db():
712
716
  raise DatabaseException('Database was not updated, daemon won\'t start')
713
717
 
714
- logging.log(logging.INFO, 'main: starting processes')
715
- rses_to_process = get_rses_to_process(rses, include_rses, exclude_rses, vos)
716
- if not rses_to_process:
717
- logging.log(logging.ERROR, 'Reaper: No RSEs found. Exiting.')
718
- return
719
-
720
- logging.log(logging.INFO, 'Reaper: This instance will work on RSEs: %s', ', '.join([rse['rse'] for rse in rses_to_process]))
721
-
722
718
  logging.log(logging.INFO, 'starting reaper threads')
723
719
  threads_list = [threading.Thread(target=reaper, kwargs={'once': once,
724
720
  'rses': rses,
@@ -75,7 +75,7 @@ def set_status(
75
75
  :param rse_id: RSE ID.
76
76
  :param status: RSE decommissioning status.
77
77
  """
78
- config = attr_to_config(get_rse_attribute(rse_id, RseAttr.DECOMMISSION))
78
+ config = attr_to_config(get_rse_attribute(rse_id, RseAttr.DECOMMISSION)) # type: ignore (get_rse_attribute could return None)
79
79
  config['status'] = status
80
80
  # add_rse_attribute can handle updating existing entries too
81
81
  add_rse_attribute(rse_id, RseAttr.DECOMMISSION, config_to_attr(config))
@@ -14,7 +14,6 @@
14
14
 
15
15
  """Generic decommissioning profiles."""
16
16
  import logging
17
- from collections.abc import Callable, Iterable
18
17
  from datetime import datetime, timedelta
19
18
  from typing import TYPE_CHECKING, Any
20
19
 
@@ -32,6 +31,8 @@ from rucio.db.sqla.constants import ReplicaState
32
31
  from .types import DecommissioningProfile, HandlerOutcome
33
32
 
34
33
  if TYPE_CHECKING:
34
+ from collections.abc import Iterable
35
+
35
36
  from rucio.common.types import LoggerFunction
36
37
 
37
38
 
@@ -137,7 +138,7 @@ def _generic_discover(
137
138
  rse: dict[str, Any],
138
139
  *,
139
140
  logger: "LoggerFunction" = logging.log
140
- ) -> Iterable[dict[str, Any]]:
141
+ ) -> 'Iterable[dict[str, Any]]':
141
142
  """Discoverer function that calls the listing function from core.rule.
142
143
 
143
144
  :param rse: RSE table entry as a dictionary.
@@ -186,7 +187,7 @@ def _generic_finalize(
186
187
 
187
188
  def _process_replicas_with_no_locks(
188
189
  rse: dict[str, Any],
189
- replicas: Iterable[dict[str, Any]],
190
+ replicas: 'Iterable[dict[str, Any]]',
190
191
  limit: int = 0,
191
192
  *,
192
193
  logger: "LoggerFunction" = logging.log,
@@ -382,7 +383,7 @@ def _call_for_attention(
382
383
  rule: dict[str, Any],
383
384
  rse: dict[str, Any],
384
385
  *,
385
- logger: Callable[..., None] = logging.log
386
+ logger: "LoggerFunction" = logging.log
386
387
  ) -> HandlerOutcome:
387
388
  return HandlerOutcome.NEED_ATTENTION
388
389
 
@@ -14,12 +14,13 @@
14
14
 
15
15
  """Types used for profile definitions."""
16
16
  import logging
17
- from collections.abc import Callable, Iterable
18
17
  from dataclasses import dataclass
19
18
  from enum import Enum
20
19
  from typing import TYPE_CHECKING, Any
21
20
 
22
21
  if TYPE_CHECKING:
22
+ from collections.abc import Callable, Iterable
23
+
23
24
  from rucio.common.types import LoggerFunction
24
25
 
25
26
 
@@ -42,10 +43,10 @@ class DecommissioningProfile:
42
43
  """
43
44
 
44
45
  rse: dict[str, Any]
45
- initializer: Callable[..., None]
46
- discoverer: Callable[..., Iterable[dict[str, Any]]]
47
- handlers: list[tuple[Callable[..., bool], Callable[..., HandlerOutcome]]]
48
- finalizer: Callable[..., bool]
46
+ initializer: "Callable[..., None]"
47
+ discoverer: "Callable[..., Iterable[dict[str, Any]]]"
48
+ handlers: list[tuple["Callable[..., bool]", "Callable[..., HandlerOutcome]"]]
49
+ finalizer: "Callable[..., bool]"
49
50
 
50
51
  def initialize(
51
52
  self,
@@ -59,7 +60,7 @@ class DecommissioningProfile:
59
60
  self,
60
61
  *,
61
62
  logger: "LoggerFunction" = logging.log
62
- ) -> Iterable[dict[str, Any]]:
63
+ ) -> 'Iterable[dict[str, Any]]':
63
64
  """Call the discoverer."""
64
65
  return self.discoverer(self.rse, logger=logger)
65
66
 
@@ -98,7 +98,7 @@ def run_once(
98
98
  # Get the decommission attribute (encodes the decommissioning config)
99
99
  attr = get_rse_attribute(rse['id'], RseAttr.DECOMMISSION)
100
100
  try:
101
- config = attr_to_config(attr)
101
+ config = attr_to_config(attr) # type: ignore (attr could be None)
102
102
  except InvalidStatusName:
103
103
  logger(logging.ERROR, 'RSE %s has an invalid decommissioning status',
104
104
  rse['rse'])
@@ -35,7 +35,7 @@ from sqlalchemy.orm.exc import FlushError
35
35
 
36
36
  from rucio.common import exception
37
37
  from rucio.common.logging import formatted_logger, setup_logging
38
- from rucio.common.types import InternalAccount, InternalScope
38
+ from rucio.common.types import InternalAccount, InternalScope, LFNDict
39
39
  from rucio.common.utils import daemon_sleep
40
40
  from rucio.core.heartbeat import die, live, sanity_check
41
41
  from rucio.core.monitor import MetricManager
@@ -443,16 +443,18 @@ def process_dark_files(
443
443
  logger(logging.INFO, 'Processing a dark file:\n RSE %s Scope: %s Name: %s'
444
444
  % (rse, scope, name))
445
445
  rse_id = get_rse_id(rse=rse)
446
- Intscope = InternalScope(scope=scope, vo=issuer.vo)
447
- lfns = [{'scope': scope, 'name': name}]
448
-
446
+ internal_scope = InternalScope(scope=scope, vo=issuer.vo)
447
+ lfn: "LFNDict" = {
448
+ 'scope': scope,
449
+ 'name': name,
450
+ }
449
451
  attributes = get_rse_info(rse=rse)
450
- pfns = lfns2pfns(rse_settings=attributes, lfns=lfns, operation='delete')
452
+ pfns = lfns2pfns(rse_settings=attributes, lfns=[lfn], operation='delete')
451
453
  pfn_key = scope + ':' + name
452
454
  url = pfns[pfn_key]
453
455
  urls = [url]
454
456
  paths = parse_pfns(attributes, urls, operation='delete')
455
- replicas = [{'scope': Intscope, 'rse_id': rse_id, 'name': name,
457
+ replicas = [{'scope': internal_scope, 'rse_id': rse_id, 'name': name,
456
458
  'path': paths[url]['path'] + paths[url]['name']}]
457
459
  add_quarantined_replicas(rse_id, replicas, session=None)
458
460
  deleted_files += 1