rucio 37.5.0__py3-none-any.whl → 37.6.0__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 (155) hide show
  1. rucio/cli/bin_legacy/rucio.py +1 -1
  2. rucio/cli/bin_legacy/rucio_admin.py +1 -1
  3. rucio/cli/did.py +2 -2
  4. rucio/cli/rse.py +2 -3
  5. rucio/cli/subscription.py +1 -1
  6. rucio/client/baseclient.py +5 -1
  7. rucio/client/didclient.py +16 -16
  8. rucio/client/downloadclient.py +14 -14
  9. rucio/client/lockclient.py +3 -3
  10. rucio/client/replicaclient.py +2 -2
  11. rucio/client/touchclient.py +1 -1
  12. rucio/client/uploadclient.py +725 -181
  13. rucio/common/config.py +1 -2
  14. rucio/common/constants.py +2 -0
  15. rucio/common/didtype.py +2 -2
  16. rucio/common/dumper/__init__.py +1 -1
  17. rucio/common/pcache.py +20 -25
  18. rucio/common/plugins.py +10 -17
  19. rucio/common/schema/__init__.py +7 -5
  20. rucio/common/utils.py +1 -1
  21. rucio/core/authentication.py +1 -1
  22. rucio/core/credential.py +1 -1
  23. rucio/core/did.py +54 -54
  24. rucio/core/did_meta_plugins/__init__.py +10 -10
  25. rucio/core/did_meta_plugins/did_column_meta.py +9 -9
  26. rucio/core/did_meta_plugins/did_meta_plugin_interface.py +3 -3
  27. rucio/core/did_meta_plugins/elasticsearch_meta.py +7 -7
  28. rucio/core/did_meta_plugins/json_meta.py +2 -2
  29. rucio/core/did_meta_plugins/mongo_meta.py +9 -9
  30. rucio/core/did_meta_plugins/postgres_meta.py +7 -7
  31. rucio/core/dirac.py +1 -1
  32. rucio/core/lifetime_exception.py +2 -2
  33. rucio/core/lock.py +7 -7
  34. rucio/core/meta_conventions.py +2 -2
  35. rucio/core/monitor.py +1 -1
  36. rucio/core/naming_convention.py +1 -1
  37. rucio/core/nongrid_trace.py +2 -2
  38. rucio/core/oidc.py +2 -2
  39. rucio/core/permission/__init__.py +7 -5
  40. rucio/core/permission/generic.py +2 -2
  41. rucio/core/permission/generic_multi_vo.py +2 -2
  42. rucio/core/replica.py +17 -17
  43. rucio/core/rule.py +30 -30
  44. rucio/core/rule_grouping.py +2 -3
  45. rucio/core/scope.py +1 -1
  46. rucio/core/trace.py +2 -2
  47. rucio/daemons/auditor/__init__.py +1 -1
  48. rucio/daemons/badreplicas/minos.py +9 -3
  49. rucio/daemons/badreplicas/minos_temporary_expiration.py +5 -2
  50. rucio/daemons/badreplicas/necromancer.py +9 -3
  51. rucio/daemons/bb8/common.py +1 -1
  52. rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
  53. rucio/daemons/bb8/t2_background_rebalance.py +1 -1
  54. rucio/daemons/cache/consumer.py +1 -1
  55. rucio/daemons/conveyor/finisher.py +13 -4
  56. rucio/daemons/conveyor/poller.py +5 -2
  57. rucio/daemons/conveyor/receiver.py +1 -1
  58. rucio/daemons/follower/follower.py +1 -1
  59. rucio/daemons/hermes/hermes.py +2 -2
  60. rucio/daemons/judge/cleaner.py +2 -2
  61. rucio/daemons/judge/evaluator.py +7 -7
  62. rucio/daemons/judge/injector.py +2 -2
  63. rucio/daemons/judge/repairer.py +2 -2
  64. rucio/daemons/replicarecoverer/suspicious_replica_recoverer.py +1 -1
  65. rucio/daemons/storage/consistency/actions.py +3 -3
  66. rucio/daemons/transmogrifier/transmogrifier.py +1 -1
  67. rucio/daemons/undertaker/undertaker.py +6 -6
  68. rucio/db/sqla/constants.py +4 -3
  69. rucio/db/sqla/migrate_repo/versions/3082b8cef557_add_naming_convention_table_and_closed_.py +1 -1
  70. rucio/db/sqla/migrate_repo/versions/4df2c5ddabc0_remove_temporary_dids.py +1 -1
  71. rucio/db/sqla/migrate_repo/versions/c129ccdb2d5_add_lumiblocknr_to_dids.py +1 -1
  72. rucio/db/sqla/models.py +1 -1
  73. rucio/db/sqla/session.py +7 -7
  74. rucio/gateway/account.py +65 -90
  75. rucio/gateway/did.py +26 -26
  76. rucio/gateway/dirac.py +1 -1
  77. rucio/gateway/lifetime_exception.py +1 -1
  78. rucio/gateway/replica.py +2 -2
  79. rucio/rse/protocols/ngarc.py +2 -2
  80. rucio/rse/protocols/srm.py +1 -1
  81. rucio/rse/protocols/webdav.py +8 -1
  82. rucio/tests/common.py +4 -4
  83. rucio/vcsversion.py +3 -3
  84. rucio/web/rest/flaskapi/v1/accounts.py +20 -20
  85. rucio/web/rest/flaskapi/v1/archives.py +2 -2
  86. rucio/web/rest/flaskapi/v1/common.py +1 -1
  87. rucio/web/rest/flaskapi/v1/dids.py +188 -188
  88. rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +5 -5
  89. rucio/web/rest/flaskapi/v1/locks.py +13 -13
  90. rucio/web/rest/flaskapi/v1/main.py +1 -0
  91. rucio/web/rest/flaskapi/v1/redirect.py +2 -2
  92. rucio/web/rest/flaskapi/v1/replicas.py +16 -16
  93. rucio/web/rest/flaskapi/v1/requests.py +16 -16
  94. rucio/web/rest/flaskapi/v1/subscriptions.py +7 -7
  95. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-account +8 -1
  96. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-rse +8 -1
  97. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-auditor +1 -1
  98. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-throttler +7 -1
  99. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-follower +1 -1
  100. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-judge-cleaner +9 -1
  101. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-necromancer +7 -1
  102. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-replica-recoverer +31 -9
  103. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-undertaker +8 -2
  104. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/METADATA +1 -1
  105. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/RECORD +155 -155
  106. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/alembic.ini.template +0 -0
  107. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
  108. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
  109. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
  110. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
  111. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
  112. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
  113. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
  114. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
  115. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
  116. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
  117. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
  118. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
  119. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
  120. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/requirements.server.txt +0 -0
  121. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/tools/bootstrap.py +0 -0
  122. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
  123. {rucio-37.5.0.data → rucio-37.6.0.data}/data/rucio/tools/reset_database.py +0 -0
  124. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio +0 -0
  125. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-collection-replica +0 -0
  126. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-admin +0 -0
  127. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-atropos +0 -0
  128. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-automatix +0 -0
  129. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-bb8 +0 -0
  130. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-cache-client +0 -0
  131. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-cache-consumer +0 -0
  132. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-finisher +0 -0
  133. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-poller +0 -0
  134. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-preparer +0 -0
  135. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-receiver +0 -0
  136. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-stager +0 -0
  137. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-submitter +0 -0
  138. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-dark-reaper +0 -0
  139. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-dumper +0 -0
  140. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-hermes +0 -0
  141. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-judge-evaluator +0 -0
  142. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-judge-injector +0 -0
  143. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-judge-repairer +0 -0
  144. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-kronos +0 -0
  145. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-minos +0 -0
  146. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
  147. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-oauth-manager +0 -0
  148. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-reaper +0 -0
  149. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-rse-decommissioner +0 -0
  150. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-storage-consistency-actions +0 -0
  151. {rucio-37.5.0.data → rucio-37.6.0.data}/scripts/rucio-transmogrifier +0 -0
  152. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/WHEEL +0 -0
  153. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/licenses/AUTHORS.rst +0 -0
  154. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/licenses/LICENSE +0 -0
  155. {rucio-37.5.0.dist-info → rucio-37.6.0.dist-info}/top_level.txt +0 -0
@@ -199,7 +199,7 @@ class ExternalPostgresJSONDidMeta(DidMetaPlugin):
199
199
  :param scope: The scope name
200
200
  :param name: The data identifier name
201
201
  :param session: The database session in use
202
- :returns: the metadata for the did
202
+ :returns: the metadata for the DID
203
203
  """
204
204
  statement = sql.SQL("SELECT data from {} WHERE scope = {} AND name = {}").format(
205
205
  sql.Identifier(self.table),
@@ -221,8 +221,8 @@ class ExternalPostgresJSONDidMeta(DidMetaPlugin):
221
221
  """
222
222
  Set single metadata key.
223
223
 
224
- :param scope: the scope of did
225
- :param name: the name of the did
224
+ :param scope: the scope of DID
225
+ :param name: the name of the DID
226
226
  :param key: the key to be added
227
227
  :param value: the value of the key to be added
228
228
  :param recursive: recurse into DIDs (not supported)
@@ -234,8 +234,8 @@ class ExternalPostgresJSONDidMeta(DidMetaPlugin):
234
234
  """
235
235
  Bulk set metadata keys.
236
236
 
237
- :param scope: the scope of did
238
- :param name: the name of the did
237
+ :param scope: the scope of DID
238
+ :param name: the name of the DID
239
239
  :param metadata: dictionary of metadata keypairs to be added
240
240
  :param recursive: recurse into DIDs (not supported)
241
241
  :param session: The database session in use
@@ -262,8 +262,8 @@ class ExternalPostgresJSONDidMeta(DidMetaPlugin):
262
262
  """
263
263
  Delete a key from metadata.
264
264
 
265
- :param scope: the scope of did
266
- :param name: the name of the did
265
+ :param scope: the scope of DID
266
+ :param name: the name of the DID
267
267
  :param key: the key to be deleted
268
268
  :param session: the database session in use
269
269
  """
rucio/core/dirac.py CHANGED
@@ -46,7 +46,7 @@ def _exists(
46
46
  session: "Session"
47
47
  ) -> tuple[bool, Optional[DIDType]]:
48
48
  """
49
- Check if the did exists
49
+ Check if the DID exists
50
50
 
51
51
  :scope: The scope
52
52
  :name: The name
@@ -85,7 +85,7 @@ def add_exception(
85
85
  """
86
86
  Add exceptions to Lifetime Model.
87
87
 
88
- :param dids: The list of dids
88
+ :param dids: The list of DIDs
89
89
  :param account: The account of the requester.
90
90
  :param pattern: The account.
91
91
  :param comments: The comments associated to the exception.
@@ -160,7 +160,7 @@ def __add_exception(
160
160
  """
161
161
  Add exceptions to Lifetime Model.
162
162
 
163
- :param dids: The list of dids
163
+ :param dids: The list of DIDs
164
164
  :param account: The account of the requester.
165
165
  :param pattern: The pattern of the exception (not used).
166
166
  :param comments: The comments associated to the exception.
rucio/core/lock.py CHANGED
@@ -81,7 +81,7 @@ def get_dataset_locks_bulk(dids: "Iterable[dict[str, Any]]", *, session: "Sessio
81
81
  Get the dataset locks of a list of datasets or containers, recursively
82
82
 
83
83
  :param dids: List of dictionaries {"scope":scope(type:InternalScope), "name":name,
84
- "type":did type(DIDType.DATASET or DIDType.CONTAINER)}, "type" is optional
84
+ "type":DID type(DIDType.DATASET or DIDType.CONTAINER)}, "type" is optional
85
85
  :param session: The db session to use.
86
86
  :return: Generator of lock_info dicts, may contain duplicates
87
87
  """
@@ -156,8 +156,8 @@ def get_replica_locks(scope: InternalScope, name: str, nowait: bool = False, res
156
156
  """
157
157
  Get the active replica locks for a file
158
158
 
159
- :param scope: Scope of the did.
160
- :param name: Name of the did.
159
+ :param scope: Scope of the DID.
160
+ :param name: Name of the DID.
161
161
  :param nowait: Nowait parameter for the FOR UPDATE statement.
162
162
  :param restrict_rses: Possible RSE_ids to filter on.
163
163
  :param session: The db session.
@@ -334,8 +334,8 @@ def successful_transfer(scope: InternalScope, name: str, rse_id: str, nowait: bo
334
334
  """
335
335
  Update the state of all replica locks because of an successful transfer
336
336
 
337
- :param scope: Scope of the did
338
- :param name: Name of the did
337
+ :param scope: Scope of the DID
338
+ :param name: Name of the DID
339
339
  :param rse_id: RSE id
340
340
  :param nowait: Nowait parameter for the for_update queries.
341
341
  :param session: DB Session.
@@ -426,8 +426,8 @@ def failed_transfer(scope: InternalScope, name: str, rse_id: str, error_message:
426
426
  Update the state of all replica locks because of a failed transfer.
427
427
  If a transfer is permanently broken for a rule, the broken_rule_id should be filled which puts this rule into the SUSPENDED state.
428
428
 
429
- :param scope: Scope of the did.
430
- :param name: Name of the did.
429
+ :param scope: Scope of the DID.
430
+ :param name: Name of the DID.
431
431
  :param rse_id: RSE id.
432
432
  :param error_message: The error why this transfer failed.
433
433
  :param broken_rule_id: Id of the rule which will be suspended.
@@ -180,10 +180,10 @@ def list_values(key: str, *, session: "Session") -> list[str]:
180
180
  @read_session
181
181
  def validate_meta(meta: dict, did_type: DIDType, *, session: "Session") -> None:
182
182
  """
183
- Validates metadata for a did.
183
+ Validates metadata for a DID.
184
184
 
185
185
  :param meta: the dictionary of metadata.
186
- :param meta: the type of the did, e.g, DATASET, CONTAINER, FILE.
186
+ :param meta: the type of the DID, e.g, DATASET, CONTAINER, FILE.
187
187
  :param session: The database session in use.
188
188
 
189
189
  :raises InvalidObject:
rucio/core/monitor.py CHANGED
@@ -444,5 +444,5 @@ class MetricManager:
444
444
  for server in self.push_gateways:
445
445
  try:
446
446
  push_to_gateway(server.strip(), job=job, registry=self.registry, grouping_key=grouping_key)
447
- except:
447
+ except Exception:
448
448
  continue
@@ -69,7 +69,7 @@ def add_naming_convention(
69
69
  new_convention.save(session=session)
70
70
  except IntegrityError:
71
71
  raise Duplicate('Naming convention already exists!')
72
- except:
72
+ except Exception:
73
73
  raise RucioException(str(format_exc()))
74
74
 
75
75
 
@@ -59,7 +59,7 @@ ROTATING_LOGGER.addHandler(ROTATING_HANDLER)
59
59
  BROKERS_ALIAS, BROKERS_RESOLVED = [], []
60
60
  try:
61
61
  BROKERS_ALIAS = config_get_list('nongrid-trace', 'brokers')
62
- except:
62
+ except Exception:
63
63
  raise Exception('Could not load brokers from configuration')
64
64
 
65
65
  PORT = config_get_int('nongrid-trace', 'port')
@@ -74,7 +74,7 @@ for broker in BROKERS_ALIAS:
74
74
  try:
75
75
  addrinfos = socket.getaddrinfo(broker, 0, socket.AF_INET, 0, socket.IPPROTO_TCP)
76
76
  BROKERS_RESOLVED = [ai[4][0] for ai in addrinfos]
77
- except:
77
+ except Exception:
78
78
  pass
79
79
 
80
80
  CONNS = []
rucio/core/oidc.py CHANGED
@@ -173,7 +173,7 @@ def __get_rucio_oidc_clients(keytimeout: int = 43200) -> tuple[dict, dict]:
173
173
  try:
174
174
  with open(IDPSECRETS) as client_secret_file:
175
175
  client_secrets = json.load(client_secret_file)
176
- except:
176
+ except Exception:
177
177
  return (clients, admin_clients)
178
178
  for iss in client_secrets:
179
179
  try:
@@ -1426,7 +1426,7 @@ def validate_jwt(json_web_token: str, *, session: "Session") -> dict[str, Any]:
1426
1426
  try:
1427
1427
  token_dict['audience'] = inspect_claims['aud']
1428
1428
  token_dict['authz_scope'] = inspect_claims['scope']
1429
- except:
1429
+ except Exception:
1430
1430
  pass
1431
1431
  METRICS.counter(name='JSONWebToken.valid').inc()
1432
1432
  # if token is valid and coming from known issuer --> check aud and scope and save it if unknown
@@ -20,7 +20,7 @@ from typing import TYPE_CHECKING, Any
20
20
 
21
21
  import rucio.core.permission.generic
22
22
  from rucio.common import config, exception
23
- from rucio.common.plugins import check_policy_package_version
23
+ from rucio.common.plugins import check_policy_module_version
24
24
  from rucio.common.policy import get_policy
25
25
 
26
26
  if TYPE_CHECKING:
@@ -54,9 +54,10 @@ if not multivo:
54
54
  policy = environ['RUCIO_POLICY_PACKAGE']
55
55
  else:
56
56
  policy = config.config_get('policy', 'package', check_config_table=False)
57
- check_policy_package_version(policy)
57
+ package_module = importlib.import_module(policy)
58
+ check_policy_module_version(package_module)
58
59
  policy = policy + ".permission"
59
- except (NoOptionError, NoSectionError):
60
+ except (NoOptionError, NoSectionError, ModuleNotFoundError):
60
61
  # fall back to old system for now
61
62
  policy = 'rucio.core.permission.' + fallback_policy.lower()
62
63
  else:
@@ -91,9 +92,10 @@ def load_permission_for_vo(vo: str) -> None:
91
92
  policy = environ[env_name]
92
93
  else:
93
94
  policy = config.config_get('policy', 'package-' + vo)
94
- check_policy_package_version(policy)
95
+ package_module = importlib.import_module(policy)
96
+ check_policy_module_version(package_module)
95
97
  policy = policy + ".permission"
96
- except (NoOptionError, NoSectionError):
98
+ except (NoOptionError, NoSectionError, ModuleNotFoundError):
97
99
  # fall back to old system for now
98
100
  try:
99
101
  policy = config.config_get('policy', 'permission')
@@ -1086,7 +1086,7 @@ def perm_add_bad_pfns(issuer: "InternalAccount", kwargs: dict[str, Any], *, sess
1086
1086
 
1087
1087
  def perm_remove_did_from_followed(issuer: "InternalAccount", kwargs: dict[str, Any], *, session: "Optional[Session]" = None) -> bool:
1088
1088
  """
1089
- Checks if an account can remove did from followed table.
1089
+ Checks if an account can remove DID from followed table.
1090
1090
 
1091
1091
  :param issuer: Account identifier which issues the command.
1092
1092
  :param kwargs: List of arguments for the action.
@@ -1101,7 +1101,7 @@ def perm_remove_did_from_followed(issuer: "InternalAccount", kwargs: dict[str, A
1101
1101
 
1102
1102
  def perm_remove_dids_from_followed(issuer: "InternalAccount", kwargs: dict[str, Any], *, session: "Optional[Session]" = None) -> bool:
1103
1103
  """
1104
- Checks if an account can bulk remove dids from followed table.
1104
+ Checks if an account can bulk remove DIDs from followed table.
1105
1105
 
1106
1106
  :param issuer: Account identifier which issues the command.
1107
1107
  :param kwargs: List of arguments for the action.
@@ -1055,7 +1055,7 @@ def perm_add_bad_pfns(issuer, kwargs, *, session: "Optional[Session]" = None):
1055
1055
 
1056
1056
  def perm_remove_did_from_followed(issuer, kwargs, *, session: "Optional[Session]" = None):
1057
1057
  """
1058
- Checks if an account can remove did from followed table.
1058
+ Checks if an account can remove DID from followed table.
1059
1059
 
1060
1060
  :param issuer: Account identifier which issues the command.
1061
1061
  :param kwargs: List of arguments for the action.
@@ -1070,7 +1070,7 @@ def perm_remove_did_from_followed(issuer, kwargs, *, session: "Optional[Session]
1070
1070
 
1071
1071
  def perm_remove_dids_from_followed(issuer, kwargs, *, session: "Optional[Session]" = None):
1072
1072
  """
1073
- Checks if an account can bulk remove dids from followed table.
1073
+ Checks if an account can bulk remove DIDs from followed table.
1074
1074
 
1075
1075
  :param issuer: Account identifier which issues the command.
1076
1076
  :param kwargs: List of arguments for the action.
rucio/core/replica.py CHANGED
@@ -1298,7 +1298,7 @@ def list_replicas(
1298
1298
  session: "Session"
1299
1299
  ) -> tuple[int, Any]:
1300
1300
  """
1301
- Find all FILE dids contained in collections from temp_table and return them in a newly
1301
+ Find all FILE DIDs contained in collections from temp_table and return them in a newly
1302
1302
  created temporary table.
1303
1303
  """
1304
1304
  resolved_files_temp_table = temp_table_mngr(session).create_scope_name_table()
@@ -1391,7 +1391,7 @@ def list_replicas(
1391
1391
  Builds a query which list the replicas of FILEs from users input, but ignores
1392
1392
  collections in the same input.
1393
1393
 
1394
- Note: These FILE dids must be returned to the user even if they don't have replicas,
1394
+ Note: These FILE DIDs must be returned to the user even if they don't have replicas,
1395
1395
  hence the outerjoin against the replicas_subquery.
1396
1396
  """
1397
1397
  return select(
@@ -1426,7 +1426,7 @@ def list_replicas(
1426
1426
  session: "Session"
1427
1427
  ) -> tuple[int, int, int]:
1428
1428
  """
1429
- Find how many files, collections and constituents are among the dids in the temp_table
1429
+ Find how many files, collections and constituents are among the DIDs in the temp_table
1430
1430
  """
1431
1431
  stmt = select(
1432
1432
  func.sum(
@@ -1493,7 +1493,7 @@ def list_replicas(
1493
1493
  nrandom
1494
1494
  # Only try this optimisation if list_replicas was called on collection(s).
1495
1495
  # I didn't consider handling the case when list_replica is called with a mix of
1496
- # file/archive/collection dids: database queries in those cases are more complex
1496
+ # file/archive/collection DIDs: database queries in those cases are more complex
1497
1497
  # and people don't usually call list_replicas with nrandom on file/archive_constituents anyway.
1498
1498
  and (num_files_in_collections and not num_constituents and not num_files)
1499
1499
  # The following code introduces overhead if it fails to pick n random replicas.
@@ -1533,7 +1533,7 @@ def list_replicas(
1533
1533
  )
1534
1534
  session.execute(stmt)
1535
1535
 
1536
- # Fetch all replicas for randomly selected dids and apply filters on python side
1536
+ # Fetch all replicas for randomly selected DIDs and apply filters on python side
1537
1537
  stmt = _list_replicas_for_collection_files_stmt(random_dids_temp_table, replicas_subquery)
1538
1538
  stmt = stmt.order_by('scope', 'name')
1539
1539
  replica_tuples = session.execute(stmt)
@@ -1583,7 +1583,7 @@ def __bulk_add_new_file_dids(
1583
1583
  session: "Session"
1584
1584
  ) -> Literal[True]:
1585
1585
  """
1586
- Bulk add new dids.
1586
+ Bulk add new DIDs.
1587
1587
 
1588
1588
  :param dids: the list of new files.
1589
1589
  :param account: The account owner.
@@ -1636,7 +1636,7 @@ def __bulk_add_file_dids(
1636
1636
  session: "Session"
1637
1637
  ) -> list[dict[str, Any]]:
1638
1638
  """
1639
- Bulk add new dids.
1639
+ Bulk add new DIDs.
1640
1640
 
1641
1641
  :param dids: the list of files.
1642
1642
  :param account: The account owner.
@@ -1703,7 +1703,7 @@ def __bulk_add_replicas(
1703
1703
  session: "Session"
1704
1704
  ) -> tuple[int, int]:
1705
1705
  """
1706
- Bulk add new dids.
1706
+ Bulk add new DIDs.
1707
1707
 
1708
1708
  :param rse_id: the RSE id.
1709
1709
  :param dids: the list of files.
@@ -2016,7 +2016,7 @@ def __cleanup_after_replica_deletion(
2016
2016
  session: "Session"
2017
2017
  ) -> None:
2018
2018
  """
2019
- Perform update of collections/archive associations/dids after the removal of their replicas
2019
+ Perform update of collections/archive associations/DIDs after the removal of their replicas
2020
2020
  :param rse_id: the rse id
2021
2021
  :param files: list of files whose replica got deleted
2022
2022
  :param session: The database session in use.
@@ -2080,7 +2080,7 @@ def __cleanup_after_replica_deletion(
2080
2080
  rse_id=rse_id). \
2081
2081
  save(session=session, flush=False)
2082
2082
 
2083
- # Delete did from the content for the last did
2083
+ # Delete DID from the content for the last DID
2084
2084
  while parents_to_analyze:
2085
2085
  did_associations_to_remove = set()
2086
2086
 
@@ -2287,7 +2287,7 @@ def __cleanup_after_replica_deletion(
2287
2287
 
2288
2288
  session.execute(stmt)
2289
2289
 
2290
- # delete empty dids
2290
+ # delete empty DIDs
2291
2291
  if did_condition:
2292
2292
  for chunk in chunks(did_condition, 10):
2293
2293
  stmt = select(
@@ -2426,7 +2426,7 @@ def __cleanup_after_replica_deletion(
2426
2426
  for chunk in chunks(messages, 100):
2427
2427
  add_messages(chunk, session=session)
2428
2428
 
2429
- # Delete dids
2429
+ # Delete DIDs
2430
2430
  dids_to_delete_filter = exists(select(1)
2431
2431
  .where(and_(models.DataIdentifier.scope == scope_name_temp_table.scope,
2432
2432
  models.DataIdentifier.name == scope_name_temp_table.name)))
@@ -2806,7 +2806,7 @@ def touch_replica(
2806
2806
  session: "Session"
2807
2807
  ) -> bool:
2808
2808
  """
2809
- Update the accessed_at timestamp of the given file replica/did but don't wait if row is locked.
2809
+ Update the accessed_at timestamp of the given file replica/DID but don't wait if row is locked.
2810
2810
 
2811
2811
  :param replica: a dictionary with the information of the affected replica.
2812
2812
  :param session: The database session in use.
@@ -2921,8 +2921,8 @@ def get_and_lock_file_replicas(
2921
2921
  """
2922
2922
  Get file replicas for a specific scope:name.
2923
2923
 
2924
- :param scope: The scope of the did.
2925
- :param name: The name of the did.
2924
+ :param scope: The scope of the DID.
2925
+ :param name: The name of the DID.
2926
2926
  :param nowait: Nowait parameter for the FOR UPDATE statement
2927
2927
  :param restrict_rses: Possible RSE_ids to filter on.
2928
2928
  :param session: The db session in use.
@@ -2957,8 +2957,8 @@ def get_source_replicas(
2957
2957
  """
2958
2958
  Get source replicas for a specific scope:name.
2959
2959
 
2960
- :param scope: The scope of the did.
2961
- :param name: The name of the did.
2960
+ :param scope: The scope of the DID.
2961
+ :param name: The name of the DID.
2962
2962
  :param soruce_rses: Possible RSE_ids to filter on.
2963
2963
  :param session: The db session in use.
2964
2964
  :returns: List of SQLAlchemy Replica Objects
rucio/core/rule.py CHANGED
@@ -191,7 +191,7 @@ def add_rule(
191
191
  logger: LoggerFunction = logging.log
192
192
  ) -> list[str]:
193
193
  """
194
- Adds a replication rule for every did in dids
194
+ Adds a replication rule for every DID in DIDs
195
195
 
196
196
  :param dids: List of data identifiers.
197
197
  :param account: Account issuing the rule.
@@ -277,7 +277,7 @@ def add_rule(
277
277
  notify_value = {'Y': RuleNotification.YES, 'C': RuleNotification.CLOSE, 'P': RuleNotification.PROGRESS}.get(notify or '', RuleNotification.NO)
278
278
 
279
279
  for elem in dids:
280
- # 3. Get the did
280
+ # 3. Get the DID
281
281
  with METRICS.timer('add_rule.get_did'):
282
282
  try:
283
283
  stmt = select(
@@ -292,7 +292,7 @@ def add_rule(
292
292
  except TypeError as error:
293
293
  raise InvalidObject(error.args) from error # https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/raise-missing-from.html
294
294
 
295
- # 3.1 If the did is a constituent, relay the rule to the archive
295
+ # 3.1 If the DID is a constituent, relay the rule to the archive
296
296
  if did.did_type == DIDType.FILE and did.constituent:
297
297
  # Check if a single replica of this DID exists; Do not put rule on file if there are only replicas on TAPE
298
298
  stmt = select(
@@ -407,7 +407,7 @@ def add_rule(
407
407
  logger(logging.DEBUG, "Forced injection of rule %s", str(new_rule.id))
408
408
 
409
409
  if asynchronous or delay_injection:
410
- # TODO: asynchronous mode only available for closed dids (on the whole tree?)
410
+ # TODO: asynchronous mode only available for closed DIDs (on the whole tree?)
411
411
  new_rule.state = RuleState.INJECT
412
412
  logger(logging.DEBUG, "Created rule %s for injection", str(new_rule.id))
413
413
  if delay_injection:
@@ -485,7 +485,7 @@ def add_rules(
485
485
  logger: LoggerFunction = logging.log
486
486
  ) -> dict[tuple[InternalScope, str], list[str]]:
487
487
  """
488
- Adds a list of replication rules to every did in dids
488
+ Adds a list of replication rules to every DID in DIDs
489
489
 
490
490
  :params dids: List of data identifiers.
491
491
  :param rules: List of dictionaries defining replication rules.
@@ -521,7 +521,7 @@ def add_rules(
521
521
  all_source_rses = list(set([rse['id'] for rse in all_source_rses]))
522
522
 
523
523
  for elem in dids:
524
- # 2. Get the did
524
+ # 2. Get the DID
525
525
  with METRICS.timer('add_rules.get_did'):
526
526
  try:
527
527
  stmt = select(
@@ -536,7 +536,7 @@ def add_rules(
536
536
  except TypeError as error:
537
537
  raise InvalidObject(error.args) from error
538
538
 
539
- # 2.1 If the did is a constituent, relay the rule to the archive
539
+ # 2.1 If the DID is a constituent, relay the rule to the archive
540
540
  if did.did_type == DIDType.FILE and did.constituent: # Check if a single replica of this DID exists
541
541
  stmt = select(
542
542
  func.count()
@@ -584,7 +584,7 @@ def add_rules(
584
584
 
585
585
  rule_ids[(elem['scope'], elem['name'])] = []
586
586
 
587
- # 3. Resolve the did into its contents
587
+ # 3. Resolve the DID into its contents
588
588
  with METRICS.timer('add_rules.resolve_dids_to_locks_replicas'):
589
589
  # Get all Replicas, not only the ones interesting for the rse_expression
590
590
  datasetfiles, locks, replicas, source_replicas = __resolve_did_to_locks_and_replicas(did=did,
@@ -828,7 +828,7 @@ def inject_rule(
828
828
  dids = [{'scope': dataset['scope'], 'name': dataset['name']} for dataset in rucio.core.did.list_child_datasets(scope=rule.scope, name=rule.name, session=session)]
829
829
  # Remove duplicates from the list of dictionaries
830
830
  dids = [dict(t) for t in {tuple(d.items()) for d in dids}]
831
- # Remove dids which already have a similar rule
831
+ # Remove DIDs which already have a similar rule
832
832
  stmt = select(
833
833
  models.ReplicationRule.id
834
834
  ).where(
@@ -881,7 +881,7 @@ def inject_rule(
881
881
  with METRICS.timer('inject_rule.create_rse_selector'):
882
882
  rseselector = RSESelector(account=rule['account'], rses=rses, weight=rule.weight, copies=rule.copies, ignore_account_limit=rule.ignore_account_limit, session=session)
883
883
 
884
- # 3. Get the did
884
+ # 3. Get the DID
885
885
  with METRICS.timer('inject_rule.get_did'):
886
886
  try:
887
887
  stmt = select(
@@ -1104,7 +1104,7 @@ def list_associated_rules_for_file(
1104
1104
  :param session: The database session in use.
1105
1105
  :raises: RucioException
1106
1106
  """
1107
- rucio.core.did.get_did(scope=scope, name=name, session=session) # Check if the did actually exists
1107
+ rucio.core.did.get_did(scope=scope, name=name, session=session) # Check if the DID actually exists
1108
1108
  stmt = select(
1109
1109
  models.ReplicationRule,
1110
1110
  models.DataIdentifier.bytes
@@ -1364,7 +1364,7 @@ def repair_rule(
1364
1364
  rule.locks_stuck_cnt = count.state_counter
1365
1365
  logger(logging.DEBUG, "Finished resetting counters for rule %s [%d/%d/%d]", str(rule.id), rule.locks_ok_cnt, rule.locks_replicating_cnt, rule.locks_stuck_cnt)
1366
1366
 
1367
- # Get the did
1367
+ # Get the DID
1368
1368
  stmt = select(
1369
1369
  models.DataIdentifier
1370
1370
  ).where(
@@ -1387,7 +1387,7 @@ def repair_rule(
1387
1387
  hard_repair = True
1388
1388
  logger(logging.DEBUG, 'Repairing rule %s in HARD mode', str(rule.id))
1389
1389
 
1390
- # Resolve the did to its contents
1390
+ # Resolve the DID to its contents
1391
1391
  datasetfiles, locks, replicas, source_replicas = __resolve_did_to_locks_and_replicas(did=did,
1392
1392
  nowait=True,
1393
1393
  restrict_rses=[rse['id'] for rse in rses],
@@ -2060,10 +2060,10 @@ def re_evaluate_did(
2060
2060
  logger: LoggerFunction = logging.log
2061
2061
  ) -> None:
2062
2062
  """
2063
- Re-Evaluates a did.
2063
+ Re-Evaluates a DID.
2064
2064
 
2065
- :param scope: The scope of the did to be re-evaluated.
2066
- :param name: The name of the did to be re-evaluated.
2065
+ :param scope: The scope of the DID to be re-evaluated.
2066
+ :param name: The name of the DID to be re-evaluated.
2067
2067
  :param rule_evaluation_action: The Rule evaluation action.
2068
2068
  :param session: The database session in use.
2069
2069
  :param logger: Optional decorated logger that can be passed from the calling daemons or servers.
@@ -2086,7 +2086,7 @@ def re_evaluate_did(
2086
2086
  else:
2087
2087
  __evaluate_did_detach(did, session=session, logger=logger)
2088
2088
 
2089
- # Update size and length of did
2089
+ # Update size and length of DID
2090
2090
  if session.bind.dialect.name == 'oracle':
2091
2091
  stmt = select(
2092
2092
  func.sum(models.DataIdentifierAssociation.bytes),
@@ -2118,12 +2118,12 @@ def get_updated_dids(
2118
2118
  session: "Session"
2119
2119
  ) -> list[tuple[str, InternalScope, str, DIDReEvaluation]]:
2120
2120
  """
2121
- Get updated dids.
2121
+ Get updated DIDs.
2122
2122
 
2123
2123
  :param total_workers: Number of total workers.
2124
2124
  :param worker_number: id of the executing worker.
2125
- :param limit: Maximum number of dids to return.
2126
- :param blocked_dids: Blocked dids to filter.
2125
+ :param limit: Maximum number of DIDs to return.
2126
+ :param blocked_dids: Blocked DIDs to filter.
2127
2127
  :param session: Database session in use.
2128
2128
  """
2129
2129
  blocked_dids = blocked_dids or []
@@ -2135,7 +2135,7 @@ def get_updated_dids(
2135
2135
  )
2136
2136
  stmt = filter_thread_work(session=session, query=stmt, total_threads=total_workers, thread_id=worker_number, hash_variable='name')
2137
2137
 
2138
- # Remove blocked dids from query, but only do the first 30 ones, not to overload the query
2138
+ # Remove blocked DIDs from query, but only do the first 30 ones, not to overload the query
2139
2139
  if blocked_dids:
2140
2140
  chunk = list(chunks(blocked_dids, 30))[0]
2141
2141
  stmt = stmt.where(tuple_(models.UpdatedDID.scope, models.UpdatedDID.name).notin_(chunk))
@@ -3403,9 +3403,9 @@ def __evaluate_did_detach(
3403
3403
  logger: LoggerFunction = logging.log
3404
3404
  ) -> None:
3405
3405
  """
3406
- Evaluate a parent did which has children removed.
3406
+ Evaluate a parent DID which has children removed.
3407
3407
 
3408
- :param eval_did: The did object in use.
3408
+ :param eval_did: The DID object in use.
3409
3409
  :param session: The database session in use.
3410
3410
  :param logger: Optional decorated logger that can be passed from the calling daemons or servers.
3411
3411
  """
@@ -3563,9 +3563,9 @@ def __evaluate_did_attach(
3563
3563
  logger: LoggerFunction = logging.log
3564
3564
  ) -> None:
3565
3565
  """
3566
- Evaluate a parent did which has new children
3566
+ Evaluate a parent DID which has new children
3567
3567
 
3568
- :param eval_did: The did object in use.
3568
+ :param eval_did: The DID object in use.
3569
3569
  :param session: The database session in use.
3570
3570
  :param logger: Optional decorated logger that can be passed from the calling daemons or servers.
3571
3571
  :raises: ReplicationRuleCreationTemporaryFailed
@@ -3793,7 +3793,7 @@ def __evaluate_did_attach(
3793
3793
  # Insert rule history
3794
3794
  insert_rule_history(rule=rule, recent=True, longterm=False, session=session)
3795
3795
 
3796
- # Unflage the dids
3796
+ # Unflag the DIDs
3797
3797
  with METRICS.timer('evaluate_did_attach.update_did'):
3798
3798
  for did in new_child_dids:
3799
3799
  did.rule_evaluation = None
@@ -3815,9 +3815,9 @@ def __resolve_did_to_locks_and_replicas(
3815
3815
  dict[tuple[str, str], models.RSEFileAssociation],
3816
3816
  dict[tuple[str, str], str]]:
3817
3817
  """
3818
- Resolves a did to its constituent children and reads the locks and replicas of all the constituent files.
3818
+ Resolves a DID to its constituent children and reads the locks and replicas of all the constituent files.
3819
3819
 
3820
- :param did: The db object of the did the rule is applied on.
3820
+ :param did: The db object of the DID the rule is applied on.
3821
3821
  :param nowait: Nowait parameter for the FOR UPDATE statement.
3822
3822
  :param restrict_rses: Possible rses of the rule, so only these replica/locks should be considered.
3823
3823
  :param source_rses: Source rses for this rule. These replicas are not row-locked.
@@ -3922,7 +3922,7 @@ def __resolve_dids_to_locks_and_replicas(
3922
3922
  dict[tuple[str, str], models.RSEFileAssociation],
3923
3923
  dict[tuple[str, str], str]]:
3924
3924
  """
3925
- Resolves a list of dids to its constituent children and reads the locks and replicas of all the constituent files.
3925
+ Resolves a list of DIDs to its constituent children and reads the locks and replicas of all the constituent files.
3926
3926
 
3927
3927
  :param dids: The list of DataIdentifierAssociation objects.
3928
3928
  :param nowait: Nowait parameter for the FOR UPDATE statement.
@@ -3940,7 +3940,7 @@ def __resolve_dids_to_locks_and_replicas(
3940
3940
  restrict_rses = restrict_rses or []
3941
3941
 
3942
3942
  if dids[0].child_type == DIDType.FILE:
3943
- # All the dids will be files!
3943
+ # All the DIDs will be files!
3944
3944
  # Prepare the datasetfiles
3945
3945
  files = []
3946
3946
  for did in dids:
@@ -1317,9 +1317,9 @@ def __set_replica_unavailable(replica, *, session: "Session"):
1317
1317
  @transactional_session
1318
1318
  def apply_rule(did, rule, rses, source_rses, rseselector, *, session: "Session", logger=logging.log):
1319
1319
  """
1320
- Apply a replication rule to one did.
1320
+ Apply a replication rule to one DID.
1321
1321
 
1322
- :param did: the did object
1322
+ :param did: the DID object
1323
1323
  :param rule: the rule object
1324
1324
  :param rses: target rses_ids
1325
1325
  :param source_rses: source rses_ids
@@ -1616,4 +1616,3 @@ def apply_rule(did, rule, rses, source_rses, rseselector, *, session: "Session",
1616
1616
  for rse_id in account_counters_files:
1617
1617
  account_counter.increase(rse_id=rse_id, account=rule.account, files=account_counters_files[rse_id], bytes_=account_counters_bytes[rse_id], session=session)
1618
1618
  session.flush()
1619
-
rucio/core/scope.py CHANGED
@@ -65,7 +65,7 @@ def add_scope(scope, account, *, session: "Session"):
65
65
  raise Duplicate('Scope \'%s\' already exists!' % scope)
66
66
  else:
67
67
  raise RucioException(e)
68
- except:
68
+ except Exception:
69
69
  raise RucioException(str(format_exc()))
70
70
 
71
71
 
rucio/core/trace.py CHANGED
@@ -71,7 +71,7 @@ ROTATING_LOGGER.addHandler(ROTATING_HANDLER)
71
71
  BROKERS_ALIAS, BROKERS_RESOLVED = [], []
72
72
  try:
73
73
  BROKERS_ALIAS = config_get_list('trace', 'brokers')
74
- except:
74
+ except Exception:
75
75
  raise Exception('Could not load brokers from configuration')
76
76
 
77
77
  PORT = config_get_int('trace', 'port')
@@ -285,7 +285,7 @@ for broker in BROKERS_ALIAS:
285
285
  try:
286
286
  addrinfos = socket.getaddrinfo(broker, 0, socket.AF_INET, 0, socket.IPPROTO_TCP)
287
287
  BROKERS_RESOLVED = [ai[4][0] for ai in addrinfos]
288
- except:
288
+ except Exception:
289
289
  pass
290
290
 
291
291
  CONNS = []