rucio 37.4.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.
- rucio/cli/bin_legacy/rucio.py +1 -1
- rucio/cli/bin_legacy/rucio_admin.py +1 -1
- rucio/cli/did.py +2 -2
- rucio/cli/rse.py +2 -3
- rucio/cli/subscription.py +1 -1
- rucio/client/baseclient.py +5 -1
- rucio/client/didclient.py +16 -16
- rucio/client/downloadclient.py +15 -15
- rucio/client/lockclient.py +3 -3
- rucio/client/replicaclient.py +2 -2
- rucio/client/requestclient.py +6 -5
- rucio/client/touchclient.py +1 -1
- rucio/client/uploadclient.py +725 -181
- rucio/common/config.py +1 -2
- rucio/common/constants.py +16 -17
- rucio/common/didtype.py +2 -2
- rucio/common/dumper/__init__.py +1 -1
- rucio/common/pcache.py +20 -25
- rucio/common/plugins.py +10 -17
- rucio/common/schema/__init__.py +7 -5
- rucio/common/utils.py +19 -3
- rucio/core/authentication.py +1 -1
- rucio/core/credential.py +1 -1
- rucio/core/did.py +54 -54
- rucio/core/did_meta_plugins/__init__.py +10 -10
- rucio/core/did_meta_plugins/did_column_meta.py +9 -9
- rucio/core/did_meta_plugins/did_meta_plugin_interface.py +3 -3
- rucio/core/did_meta_plugins/elasticsearch_meta.py +7 -7
- rucio/core/did_meta_plugins/json_meta.py +2 -2
- rucio/core/did_meta_plugins/mongo_meta.py +9 -9
- rucio/core/did_meta_plugins/postgres_meta.py +7 -7
- rucio/core/dirac.py +1 -1
- rucio/core/lifetime_exception.py +2 -2
- rucio/core/lock.py +7 -7
- rucio/core/meta_conventions.py +2 -2
- rucio/core/monitor.py +1 -1
- rucio/core/naming_convention.py +1 -1
- rucio/core/nongrid_trace.py +2 -2
- rucio/core/oidc.py +2 -2
- rucio/core/permission/__init__.py +7 -5
- rucio/core/permission/generic.py +5 -2
- rucio/core/permission/generic_multi_vo.py +2 -2
- rucio/core/replica.py +18 -18
- rucio/core/request.py +2 -2
- rucio/core/rule.py +30 -30
- rucio/core/rule_grouping.py +2 -3
- rucio/core/scope.py +1 -1
- rucio/core/trace.py +2 -2
- rucio/core/transfer.py +4 -5
- rucio/daemons/auditor/__init__.py +1 -1
- rucio/daemons/badreplicas/minos.py +9 -3
- rucio/daemons/badreplicas/minos_temporary_expiration.py +5 -2
- rucio/daemons/badreplicas/necromancer.py +9 -3
- rucio/daemons/bb8/common.py +1 -1
- rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
- rucio/daemons/bb8/t2_background_rebalance.py +1 -1
- rucio/daemons/cache/consumer.py +1 -1
- rucio/daemons/conveyor/finisher.py +13 -4
- rucio/daemons/conveyor/poller.py +5 -2
- rucio/daemons/conveyor/receiver.py +1 -1
- rucio/daemons/conveyor/throttler.py +2 -1
- rucio/daemons/follower/follower.py +1 -1
- rucio/daemons/hermes/hermes.py +2 -2
- rucio/daemons/judge/cleaner.py +2 -2
- rucio/daemons/judge/evaluator.py +7 -7
- rucio/daemons/judge/injector.py +2 -2
- rucio/daemons/judge/repairer.py +2 -2
- rucio/daemons/replicarecoverer/suspicious_replica_recoverer.py +1 -1
- rucio/daemons/storage/consistency/actions.py +3 -3
- rucio/daemons/transmogrifier/transmogrifier.py +1 -1
- rucio/daemons/undertaker/undertaker.py +6 -6
- rucio/db/sqla/constants.py +4 -3
- rucio/db/sqla/migrate_repo/versions/13d4f70c66a9_introduce_transfer_limits.py +1 -1
- rucio/db/sqla/migrate_repo/versions/3082b8cef557_add_naming_convention_table_and_closed_.py +1 -1
- rucio/db/sqla/migrate_repo/versions/4df2c5ddabc0_remove_temporary_dids.py +1 -1
- rucio/db/sqla/migrate_repo/versions/c129ccdb2d5_add_lumiblocknr_to_dids.py +1 -1
- rucio/db/sqla/models.py +2 -2
- rucio/db/sqla/session.py +7 -7
- rucio/gateway/account.py +65 -90
- rucio/gateway/did.py +26 -26
- rucio/gateway/dirac.py +1 -1
- rucio/gateway/lifetime_exception.py +1 -1
- rucio/gateway/replica.py +2 -2
- rucio/gateway/request.py +13 -12
- rucio/rse/protocols/ngarc.py +2 -2
- rucio/rse/protocols/srm.py +1 -1
- rucio/rse/protocols/webdav.py +8 -1
- rucio/rse/rsemanager.py +2 -2
- rucio/tests/common.py +4 -4
- rucio/vcsversion.py +3 -3
- rucio/web/rest/flaskapi/v1/accountlimits.py +22 -22
- rucio/web/rest/flaskapi/v1/accounts.py +177 -177
- rucio/web/rest/flaskapi/v1/archives.py +10 -10
- rucio/web/rest/flaskapi/v1/auth.py +106 -106
- rucio/web/rest/flaskapi/v1/common.py +1 -1
- rucio/web/rest/flaskapi/v1/config.py +37 -37
- rucio/web/rest/flaskapi/v1/credentials.py +25 -25
- rucio/web/rest/flaskapi/v1/dids.py +391 -391
- rucio/web/rest/flaskapi/v1/dirac.py +8 -8
- rucio/web/rest/flaskapi/v1/export.py +6 -6
- rucio/web/rest/flaskapi/v1/heartbeats.py +14 -14
- rucio/web/rest/flaskapi/v1/identities.py +25 -25
- rucio/web/rest/flaskapi/v1/import.py +19 -19
- rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +54 -54
- rucio/web/rest/flaskapi/v1/locks.py +62 -62
- rucio/web/rest/flaskapi/v1/main.py +1 -0
- rucio/web/rest/flaskapi/v1/meta_conventions.py +29 -29
- rucio/web/rest/flaskapi/v1/nongrid_traces.py +4 -4
- rucio/web/rest/flaskapi/v1/ping.py +4 -4
- rucio/web/rest/flaskapi/v1/redirect.py +16 -16
- rucio/web/rest/flaskapi/v1/replicas.py +282 -282
- rucio/web/rest/flaskapi/v1/requests.py +274 -270
- rucio/web/rest/flaskapi/v1/rses.py +427 -427
- rucio/web/rest/flaskapi/v1/rules.py +129 -129
- rucio/web/rest/flaskapi/v1/scopes.py +21 -21
- rucio/web/rest/flaskapi/v1/subscriptions.py +120 -120
- rucio/web/rest/flaskapi/v1/traces.py +18 -18
- rucio/web/rest/flaskapi/v1/vos.py +32 -32
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/requirements.server.txt +1 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-account +8 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-rse +8 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-auditor +1 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-throttler +7 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-follower +1 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-judge-cleaner +9 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-necromancer +7 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-replica-recoverer +31 -9
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-undertaker +8 -2
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/METADATA +1 -1
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/RECORD +179 -179
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/WHEEL +1 -1
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/alembic.ini.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-admin +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-atropos +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-automatix +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-bb8 +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-cache-client +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-receiver +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-dumper +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-hermes +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-judge-injector +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-kronos +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-minos +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-reaper +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-37.4.0.data → rucio-37.6.0.data}/scripts/rucio-transmogrifier +0 -0
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {rucio-37.4.0.dist-info → rucio-37.6.0.dist-info}/licenses/LICENSE +0 -0
- {rucio-37.4.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
|
|
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
|
|
225
|
-
:param name: the name of the
|
|
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
|
|
238
|
-
:param name: the name of the
|
|
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
|
|
266
|
-
:param name: the name of the
|
|
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
rucio/core/lifetime_exception.py
CHANGED
|
@@ -85,7 +85,7 @@ def add_exception(
|
|
|
85
85
|
"""
|
|
86
86
|
Add exceptions to Lifetime Model.
|
|
87
87
|
|
|
88
|
-
:param dids: The list of
|
|
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
|
|
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":
|
|
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
|
|
160
|
-
:param name: Name of the
|
|
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
|
|
338
|
-
:param name: Name of the
|
|
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
|
|
430
|
-
:param name: Name of the
|
|
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.
|
rucio/core/meta_conventions.py
CHANGED
|
@@ -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
|
|
183
|
+
Validates metadata for a DID.
|
|
184
184
|
|
|
185
185
|
:param meta: the dictionary of metadata.
|
|
186
|
-
:param meta: the type of the
|
|
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
rucio/core/naming_convention.py
CHANGED
rucio/core/nongrid_trace.py
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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')
|
rucio/core/permission/generic.py
CHANGED
|
@@ -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
|
|
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
|
|
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.
|
|
@@ -1126,6 +1126,7 @@ def perm_export(issuer: "InternalAccount", kwargs: dict[str, Any], *, session: "
|
|
|
1126
1126
|
"""
|
|
1127
1127
|
return _is_root(issuer)
|
|
1128
1128
|
|
|
1129
|
+
|
|
1129
1130
|
def perm_list_transfer_limits(issuer: "InternalAccount", kwargs: dict[str, Any], *, session: "Optional[Session]" = None) -> bool:
|
|
1130
1131
|
"""
|
|
1131
1132
|
Checks if an account can list transfer limits.
|
|
@@ -1137,6 +1138,7 @@ def perm_list_transfer_limits(issuer: "InternalAccount", kwargs: dict[str, Any],
|
|
|
1137
1138
|
"""
|
|
1138
1139
|
return _is_root(issuer) or has_account_attribute(account=issuer, key='admin', session=session)
|
|
1139
1140
|
|
|
1141
|
+
|
|
1140
1142
|
def perm_set_transfer_limit(issuer: "InternalAccount", kwargs: dict[str, Any], *, session: "Optional[Session]" = None) -> bool:
|
|
1141
1143
|
"""
|
|
1142
1144
|
Checks if an account can set transfer limits.
|
|
@@ -1148,6 +1150,7 @@ def perm_set_transfer_limit(issuer: "InternalAccount", kwargs: dict[str, Any], *
|
|
|
1148
1150
|
"""
|
|
1149
1151
|
return _is_root(issuer) or has_account_attribute(account=issuer, key='admin', session=session)
|
|
1150
1152
|
|
|
1153
|
+
|
|
1151
1154
|
def perm_delete_transfer_limit(issuer: "InternalAccount", kwargs: dict[str, Any], *, session: "Optional[Session]" = None) -> bool:
|
|
1152
1155
|
"""
|
|
1153
1156
|
Checks if an account can delete transfer limits.
|
|
@@ -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
|
|
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
|
|
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
|
@@ -402,7 +402,7 @@ def __declare_bad_file_replicas(
|
|
|
402
402
|
if f"{pfn} Unknown replica" not in unknown_replicas:
|
|
403
403
|
unknown_replicas.append('%s %s' % (pfn, 'Unknown replica'))
|
|
404
404
|
elif scope or name:
|
|
405
|
-
unknown_replicas.append(f"{(scope,name)} Unknown replica")
|
|
405
|
+
unknown_replicas.append(f"{(scope, name)} Unknown replica")
|
|
406
406
|
|
|
407
407
|
if status == BadFilesStatus.BAD:
|
|
408
408
|
# For BAD file, we modify the replica state, not for suspicious
|
|
@@ -1298,7 +1298,7 @@ def list_replicas(
|
|
|
1298
1298
|
session: "Session"
|
|
1299
1299
|
) -> tuple[int, Any]:
|
|
1300
1300
|
"""
|
|
1301
|
-
Find all FILE
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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/
|
|
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
|
|
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
|
|
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
|
|
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/
|
|
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
|
|
2925
|
-
:param name: The name of the
|
|
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
|
|
2961
|
-
:param name: The name of the
|
|
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/request.py
CHANGED
|
@@ -31,7 +31,7 @@ from sqlalchemy.orm import aliased
|
|
|
31
31
|
from sqlalchemy.sql.expression import asc, false, func, null, true
|
|
32
32
|
|
|
33
33
|
from rucio.common.config import config_get_bool, config_get_int
|
|
34
|
-
from rucio.common.constants import RseAttr
|
|
34
|
+
from rucio.common.constants import RseAttr, TransferLimitDirection
|
|
35
35
|
from rucio.common.exception import InvalidRSEExpression, RequestNotFound, RucioException, UnsupportedOperation
|
|
36
36
|
from rucio.common.types import FilterDict, InternalAccount, InternalScope, LoggerFunction, RequestDict
|
|
37
37
|
from rucio.common.utils import chunks, generate_uuid
|
|
@@ -41,7 +41,7 @@ from rucio.core.monitor import MetricManager
|
|
|
41
41
|
from rucio.core.rse import RseCollection, RseData, get_rse_attribute, get_rse_name, get_rse_vo
|
|
42
42
|
from rucio.core.rse_expression_parser import parse_expression
|
|
43
43
|
from rucio.db.sqla import filter_thread_work, models
|
|
44
|
-
from rucio.db.sqla.constants import LockState, ReplicaState, RequestErrMsg, RequestState, RequestType
|
|
44
|
+
from rucio.db.sqla.constants import LockState, ReplicaState, RequestErrMsg, RequestState, RequestType
|
|
45
45
|
from rucio.db.sqla.session import read_session, stream_session, transactional_session
|
|
46
46
|
from rucio.db.sqla.util import temp_table_mngr
|
|
47
47
|
|