rucio 37.1.0.post1__py3-none-any.whl → 37.3.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 (106) hide show
  1. rucio/common/plugins.py +1 -1
  2. rucio/common/utils.py +17 -10
  3. rucio/core/did.py +32 -4
  4. rucio/core/did_meta_plugins/did_column_meta.py +1 -1
  5. rucio/core/replica.py +1 -1
  6. rucio/db/sqla/util.py +1 -1
  7. rucio/gateway/authentication.py +58 -88
  8. rucio/gateway/config.py +63 -75
  9. rucio/gateway/credential.py +11 -17
  10. rucio/gateway/did.py +245 -329
  11. rucio/gateway/dirac.py +33 -34
  12. rucio/gateway/exporter.py +27 -30
  13. rucio/gateway/heartbeat.py +15 -19
  14. rucio/gateway/importer.py +12 -14
  15. rucio/gateway/lifetime_exception.py +16 -24
  16. rucio/gateway/lock.py +27 -40
  17. rucio/gateway/meta_conventions.py +19 -28
  18. rucio/gateway/quarantined_replica.py +24 -27
  19. rucio/gateway/replica.py +223 -226
  20. rucio/gateway/rse.py +191 -218
  21. rucio/gateway/rule.py +115 -146
  22. rucio/gateway/scope.py +18 -25
  23. rucio/gateway/trace.py +48 -0
  24. rucio/gateway/vo.py +32 -37
  25. rucio/vcsversion.py +3 -3
  26. rucio/web/rest/flaskapi/v1/accounts.py +2 -2
  27. rucio/web/rest/flaskapi/v1/auth.py +15 -0
  28. rucio/web/rest/flaskapi/v1/common.py +20 -0
  29. rucio/web/rest/flaskapi/v1/config.py +7 -7
  30. rucio/web/rest/flaskapi/v1/credentials.py +20 -13
  31. rucio/web/rest/flaskapi/v1/dids.py +55 -55
  32. rucio/web/rest/flaskapi/v1/dirac.py +2 -2
  33. rucio/web/rest/flaskapi/v1/export.py +1 -1
  34. rucio/web/rest/flaskapi/v1/heartbeats.py +3 -3
  35. rucio/web/rest/flaskapi/v1/import.py +1 -1
  36. rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +5 -5
  37. rucio/web/rest/flaskapi/v1/locks.py +4 -4
  38. rucio/web/rest/flaskapi/v1/main.py +17 -10
  39. rucio/web/rest/flaskapi/v1/meta_conventions.py +3 -3
  40. rucio/web/rest/flaskapi/v1/replicas.py +31 -30
  41. rucio/web/rest/flaskapi/v1/rses.py +37 -37
  42. rucio/web/rest/flaskapi/v1/rules.py +15 -15
  43. rucio/web/rest/flaskapi/v1/scopes.py +3 -3
  44. rucio/web/rest/flaskapi/v1/traces.py +75 -77
  45. rucio/web/rest/flaskapi/v1/vos.py +5 -7
  46. {rucio-37.1.0.post1.dist-info → rucio-37.3.0.dist-info}/METADATA +1 -2
  47. {rucio-37.1.0.post1.dist-info → rucio-37.3.0.dist-info}/RECORD +106 -105
  48. {rucio-37.1.0.post1.dist-info → rucio-37.3.0.dist-info}/WHEEL +1 -1
  49. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/alembic.ini.template +0 -0
  50. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
  51. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
  52. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
  53. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
  54. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
  55. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
  56. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
  57. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
  58. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
  59. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
  60. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
  61. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
  62. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
  63. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/requirements.server.txt +0 -0
  64. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/tools/bootstrap.py +0 -0
  65. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
  66. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/data/rucio/tools/reset_database.py +0 -0
  67. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio +0 -0
  68. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-abacus-account +0 -0
  69. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-abacus-collection-replica +0 -0
  70. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-abacus-rse +0 -0
  71. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-admin +0 -0
  72. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-atropos +0 -0
  73. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-auditor +0 -0
  74. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-automatix +0 -0
  75. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-bb8 +0 -0
  76. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-cache-client +0 -0
  77. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-cache-consumer +0 -0
  78. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-conveyor-finisher +0 -0
  79. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-conveyor-poller +0 -0
  80. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-conveyor-preparer +0 -0
  81. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-conveyor-receiver +0 -0
  82. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-conveyor-stager +0 -0
  83. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-conveyor-submitter +0 -0
  84. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-conveyor-throttler +0 -0
  85. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-dark-reaper +0 -0
  86. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-dumper +0 -0
  87. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-follower +0 -0
  88. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-hermes +0 -0
  89. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-judge-cleaner +0 -0
  90. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-judge-evaluator +0 -0
  91. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-judge-injector +0 -0
  92. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-judge-repairer +0 -0
  93. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-kronos +0 -0
  94. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-minos +0 -0
  95. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
  96. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-necromancer +0 -0
  97. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-oauth-manager +0 -0
  98. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-reaper +0 -0
  99. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-replica-recoverer +0 -0
  100. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-rse-decommissioner +0 -0
  101. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-storage-consistency-actions +0 -0
  102. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-transmogrifier +0 -0
  103. {rucio-37.1.0.post1.data → rucio-37.3.0.data}/scripts/rucio-undertaker +0 -0
  104. {rucio-37.1.0.post1.dist-info → rucio-37.3.0.dist-info}/licenses/AUTHORS.rst +0 -0
  105. {rucio-37.1.0.post1.dist-info → rucio-37.3.0.dist-info}/licenses/LICENSE +0 -0
  106. {rucio-37.1.0.post1.dist-info → rucio-37.3.0.dist-info}/top_level.txt +0 -0
@@ -18,24 +18,20 @@ from rucio.common import exception
18
18
  from rucio.common.types import InternalScope
19
19
  from rucio.core.quarantined_replica import add_quarantined_replicas
20
20
  from rucio.core.rse import get_rse_id
21
- from rucio.db.sqla.session import transactional_session
21
+ from rucio.db.sqla.constants import DatabaseOperationType
22
+ from rucio.db.sqla.session import db_session
22
23
  from rucio.gateway import permission
23
24
 
24
25
  if TYPE_CHECKING:
25
26
  from collections.abc import Iterable
26
27
 
27
- from sqlalchemy.orm import Session
28
28
 
29
-
30
- @transactional_session
31
29
  def quarantine_file_replicas(
32
30
  replicas: "Iterable[dict[str, Any]]",
33
31
  issuer: str,
34
32
  rse: Optional[str] = None,
35
33
  rse_id: Optional[str] = None,
36
34
  vo: str = 'def',
37
- *,
38
- session: "Session"
39
35
  ) -> None:
40
36
  """
41
37
  Quarantine replicas.
@@ -45,7 +41,6 @@ def quarantine_file_replicas(
45
41
  :param vo: The VO to act on.
46
42
  :param rse: RSE name
47
43
  :param rse_id: RSE id - either RSE name or RSE id must be specified
48
- :param session: The database session in use.
49
44
  """
50
45
 
51
46
  if not replicas:
@@ -54,26 +49,28 @@ def quarantine_file_replicas(
54
49
  if (rse is None) == (rse_id is None):
55
50
  raise exception.InputValidationError("Either RSE name or RSE id must be specified, but not both")
56
51
 
57
- if rse_id is None:
58
- rse_id = get_rse_id(rse, vo=vo, session=session)
52
+ with db_session(DatabaseOperationType.WRITE) as session:
53
+
54
+ if rse_id is None:
55
+ rse_id = get_rse_id(rse, vo=vo, session=session)
59
56
 
60
- auth_result = permission.has_permission(issuer, 'quarantine_file_replicas', {}, vo=vo, session=session)
61
- if not auth_result.allowed:
62
- raise exception.AccessDenied('Account %s can not quarantine replicas. %s' % (issuer, auth_result.message))
57
+ auth_result = permission.has_permission(issuer, 'quarantine_file_replicas', {}, vo=vo, session=session)
58
+ if not auth_result.allowed:
59
+ raise exception.AccessDenied('Account %s can not quarantine replicas. %s' % (issuer, auth_result.message))
63
60
 
64
- replica_infos = []
65
- for r in replicas:
66
- if "path" not in r:
67
- raise exception.InputValidationError("Replica info must include path")
68
- scope = r.get("scope")
69
- if scope and isinstance(scope, str):
70
- scope = InternalScope(scope, vo=vo)
71
- replica_infos.append(
72
- {
73
- "scope": scope or None,
74
- "name": r.get("name"),
75
- "path": r["path"]
76
- }
77
- )
61
+ replica_infos = []
62
+ for r in replicas:
63
+ if "path" not in r:
64
+ raise exception.InputValidationError("Replica info must include path")
65
+ scope = r.get("scope")
66
+ if scope and isinstance(scope, str):
67
+ scope = InternalScope(scope, vo=vo)
68
+ replica_infos.append(
69
+ {
70
+ "scope": scope or None,
71
+ "name": r.get("name"),
72
+ "path": r["path"]
73
+ }
74
+ )
78
75
 
79
- add_quarantined_replicas(rse_id, replica_infos, session=session)
76
+ add_quarantined_replicas(rse_id, replica_infos, session=session)