rucio 37.5.0__py3-none-any.whl → 37.7.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 +41 -22
- rucio/cli/bin_legacy/rucio_admin.py +1 -1
- rucio/cli/did.py +2 -2
- rucio/cli/rse.py +2 -3
- rucio/cli/rule.py +9 -5
- rucio/cli/subscription.py +1 -1
- rucio/client/baseclient.py +9 -4
- rucio/client/didclient.py +16 -16
- rucio/client/downloadclient.py +16 -15
- rucio/client/exportclient.py +45 -4
- rucio/client/lockclient.py +3 -3
- rucio/client/pingclient.py +35 -4
- rucio/client/replicaclient.py +2 -2
- rucio/client/touchclient.py +3 -2
- rucio/client/uploadclient.py +728 -183
- rucio/common/cache.py +1 -2
- rucio/common/client.py +4 -30
- rucio/common/config.py +27 -3
- rucio/common/constants.py +5 -1
- rucio/common/didtype.py +2 -2
- rucio/common/dumper/__init__.py +1 -1
- rucio/common/pcache.py +20 -25
- rucio/common/plugins.py +12 -19
- rucio/common/policy.py +3 -2
- rucio/common/schema/__init__.py +11 -8
- rucio/common/types.py +7 -5
- rucio/common/utils.py +1 -1
- rucio/core/account.py +2 -1
- rucio/core/account_limit.py +3 -2
- rucio/core/authentication.py +1 -1
- rucio/core/credential.py +1 -1
- rucio/core/did.py +62 -61
- 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 +3 -2
- rucio/core/distance.py +2 -1
- rucio/core/exporter.py +3 -2
- rucio/core/importer.py +5 -5
- 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 +9 -6
- rucio/core/permission/generic.py +2 -2
- rucio/core/permission/generic_multi_vo.py +2 -2
- rucio/core/replica.py +22 -22
- rucio/core/request.py +2 -2
- rucio/core/rse.py +7 -7
- rucio/core/rule.py +38 -38
- rucio/core/rule_grouping.py +2 -3
- rucio/core/scope.py +1 -1
- rucio/core/trace.py +2 -2
- rucio/core/transfer.py +2 -2
- rucio/core/vo.py +2 -1
- rucio/daemons/atropos/atropos.py +2 -1
- rucio/daemons/auditor/__init__.py +1 -1
- rucio/daemons/automatix/automatix.py +5 -5
- rucio/daemons/badreplicas/minos.py +12 -5
- rucio/daemons/badreplicas/minos_temporary_expiration.py +5 -2
- rucio/daemons/badreplicas/necromancer.py +9 -3
- rucio/daemons/bb8/bb8.py +2 -1
- rucio/daemons/bb8/common.py +1 -1
- rucio/daemons/bb8/nuclei_background_rebalance.py +3 -3
- rucio/daemons/bb8/t2_background_rebalance.py +1 -1
- rucio/daemons/cache/consumer.py +1 -1
- rucio/daemons/conveyor/common.py +3 -3
- rucio/daemons/conveyor/finisher.py +13 -4
- rucio/daemons/conveyor/poller.py +5 -2
- rucio/daemons/conveyor/receiver.py +1 -1
- rucio/daemons/conveyor/submitter.py +2 -1
- rucio/daemons/follower/follower.py +1 -1
- rucio/daemons/hermes/hermes.py +29 -8
- 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/reaper/dark_reaper.py +5 -4
- rucio/daemons/reaper/reaper.py +7 -7
- rucio/daemons/replicarecoverer/suspicious_replica_recoverer.py +4 -4
- rucio/daemons/storage/consistency/actions.py +3 -3
- rucio/daemons/tracer/kronos.py +3 -2
- rucio/daemons/transmogrifier/transmogrifier.py +71 -69
- rucio/daemons/undertaker/undertaker.py +8 -7
- rucio/db/sqla/constants.py +4 -3
- 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 +3 -3
- rucio/db/sqla/session.py +7 -7
- rucio/db/sqla/util.py +3 -2
- rucio/gateway/account.py +77 -101
- rucio/gateway/account_limit.py +90 -116
- rucio/gateway/authentication.py +9 -8
- rucio/gateway/config.py +11 -10
- rucio/gateway/credential.py +2 -1
- rucio/gateway/did.py +58 -58
- rucio/gateway/dirac.py +3 -2
- rucio/gateway/exporter.py +2 -1
- rucio/gateway/heartbeat.py +3 -2
- rucio/gateway/identity.py +4 -3
- rucio/gateway/importer.py +2 -1
- rucio/gateway/lifetime_exception.py +5 -4
- rucio/gateway/lock.py +6 -5
- rucio/gateway/meta_conventions.py +3 -2
- rucio/gateway/permission.py +2 -1
- rucio/gateway/quarantined_replica.py +2 -1
- rucio/gateway/replica.py +20 -20
- rucio/gateway/request.py +10 -10
- rucio/gateway/rse.py +27 -26
- rucio/gateway/rule.py +12 -11
- rucio/gateway/scope.py +4 -3
- rucio/gateway/subscription.py +7 -6
- rucio/gateway/vo.py +5 -4
- rucio/rse/__init__.py +7 -6
- 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 +5 -4
- rucio/rse/translation.py +2 -2
- rucio/tests/common.py +6 -5
- rucio/vcsversion.py +3 -3
- rucio/web/rest/flaskapi/v1/accountlimits.py +5 -5
- rucio/web/rest/flaskapi/v1/accounts.py +20 -20
- rucio/web/rest/flaskapi/v1/archives.py +4 -3
- rucio/web/rest/flaskapi/v1/common.py +5 -4
- rucio/web/rest/flaskapi/v1/dids.py +382 -331
- rucio/web/rest/flaskapi/v1/lifetime_exceptions.py +5 -5
- rucio/web/rest/flaskapi/v1/locks.py +13 -13
- rucio/web/rest/flaskapi/v1/main.py +1 -0
- rucio/web/rest/flaskapi/v1/redirect.py +2 -2
- rucio/web/rest/flaskapi/v1/replicas.py +16 -16
- rucio/web/rest/flaskapi/v1/requests.py +16 -16
- rucio/web/rest/flaskapi/v1/subscriptions.py +7 -7
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-account +8 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-rse +8 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-auditor +1 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-throttler +7 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-follower +1 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-cleaner +9 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-necromancer +7 -1
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-replica-recoverer +31 -9
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-undertaker +8 -2
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/METADATA +1 -1
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/RECORD +202 -202
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/alembic.ini.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/requirements.server.txt +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-admin +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-atropos +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-automatix +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-bb8 +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-cache-client +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-receiver +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-dumper +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-hermes +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-injector +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-kronos +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-minos +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-reaper +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-37.5.0.data → rucio-37.7.0.data}/scripts/rucio-transmogrifier +0 -0
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/WHEEL +0 -0
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/licenses/LICENSE +0 -0
- {rucio-37.5.0.dist-info → rucio-37.7.0.dist-info}/top_level.txt +0 -0
rucio/gateway/vo.py
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
from typing import Any, Optional
|
|
16
16
|
|
|
17
17
|
from rucio.common import exception
|
|
18
|
+
from rucio.common.constants import DEFAULT_VO
|
|
18
19
|
from rucio.common.schema import validate_schema
|
|
19
20
|
from rucio.common.types import InternalAccount
|
|
20
21
|
from rucio.core import identity
|
|
@@ -24,7 +25,7 @@ from rucio.db.sqla.session import db_session
|
|
|
24
25
|
from rucio.gateway.permission import has_permission
|
|
25
26
|
|
|
26
27
|
|
|
27
|
-
def add_vo(new_vo: str, issuer: str, description: Optional[str] = None, email: Optional[str] = None, vo: str =
|
|
28
|
+
def add_vo(new_vo: str, issuer: str, description: Optional[str] = None, email: Optional[str] = None, vo: str = DEFAULT_VO) -> None:
|
|
28
29
|
'''
|
|
29
30
|
Add a new VO.
|
|
30
31
|
|
|
@@ -48,7 +49,7 @@ def add_vo(new_vo: str, issuer: str, description: Optional[str] = None, email: O
|
|
|
48
49
|
vo_core.add_vo(vo=new_vo, description=description, email=email, session=session)
|
|
49
50
|
|
|
50
51
|
|
|
51
|
-
def list_vos(issuer: str, vo: str =
|
|
52
|
+
def list_vos(issuer: str, vo: str = DEFAULT_VO) -> list[dict[str, Any]]:
|
|
52
53
|
'''
|
|
53
54
|
List the VOs.
|
|
54
55
|
|
|
@@ -73,7 +74,7 @@ def recover_vo_root_identity(
|
|
|
73
74
|
issuer: str,
|
|
74
75
|
default: bool = False,
|
|
75
76
|
password: Optional[str] = None,
|
|
76
|
-
vo: str =
|
|
77
|
+
vo: str = DEFAULT_VO,
|
|
77
78
|
) -> None:
|
|
78
79
|
"""
|
|
79
80
|
Adds a membership association between identity and the root account for given VO.
|
|
@@ -101,7 +102,7 @@ def recover_vo_root_identity(
|
|
|
101
102
|
email=email, account=account, password=password, session=session)
|
|
102
103
|
|
|
103
104
|
|
|
104
|
-
def update_vo(updated_vo: str, parameters: dict[str, Any], issuer: str, vo: str =
|
|
105
|
+
def update_vo(updated_vo: str, parameters: dict[str, Any], issuer: str, vo: str = DEFAULT_VO) -> None:
|
|
105
106
|
"""
|
|
106
107
|
Update VO properties (email, description).
|
|
107
108
|
|
rucio/rse/__init__.py
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
from dogpile.cache import make_region
|
|
16
16
|
|
|
17
|
-
from rucio.common.
|
|
17
|
+
from rucio.common.config import is_client
|
|
18
|
+
from rucio.common.constants import DEFAULT_VO
|
|
18
19
|
from rucio.rse import rsemanager
|
|
19
20
|
|
|
20
21
|
if is_client():
|
|
@@ -25,7 +26,7 @@ else:
|
|
|
25
26
|
setattr(rsemanager, 'SERVER_MODE', True)
|
|
26
27
|
|
|
27
28
|
|
|
28
|
-
def get_rse_client(rse, vo=
|
|
29
|
+
def get_rse_client(rse, vo=DEFAULT_VO, **kwarg):
|
|
29
30
|
'''
|
|
30
31
|
get_rse_client
|
|
31
32
|
'''
|
|
@@ -34,7 +35,7 @@ def get_rse_client(rse, vo='def', **kwarg):
|
|
|
34
35
|
return client.get_rse(rse)
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
def get_signed_url_client(rse, service, op, url, vo=
|
|
38
|
+
def get_signed_url_client(rse, service, op, url, vo=DEFAULT_VO):
|
|
38
39
|
'''
|
|
39
40
|
get_signed_url_client
|
|
40
41
|
'''
|
|
@@ -42,7 +43,7 @@ def get_signed_url_client(rse, service, op, url, vo='def'):
|
|
|
42
43
|
return CredentialClient(vo=vo).get_signed_url(rse, service, op, url)
|
|
43
44
|
|
|
44
45
|
|
|
45
|
-
def get_signed_url_server(rse, service, op, url, vo=
|
|
46
|
+
def get_signed_url_server(rse, service, op, url, vo=DEFAULT_VO):
|
|
46
47
|
'''
|
|
47
48
|
get_signed_url_server
|
|
48
49
|
'''
|
|
@@ -57,7 +58,7 @@ def rse_key_generator(namespace, fn, **kwargs):
|
|
|
57
58
|
'''
|
|
58
59
|
Key generator for RSE
|
|
59
60
|
'''
|
|
60
|
-
def generate_key(rse, vo=
|
|
61
|
+
def generate_key(rse, vo=DEFAULT_VO, session=None):
|
|
61
62
|
'''
|
|
62
63
|
generate_key
|
|
63
64
|
'''
|
|
@@ -81,7 +82,7 @@ if rsemanager.SERVER_MODE: # pylint:disable=no-member
|
|
|
81
82
|
from rucio.core.rse import get_rse_id, get_rse_protocols
|
|
82
83
|
from rucio.core.vo import map_vo
|
|
83
84
|
|
|
84
|
-
def tmp_rse_info(rse=None, vo=
|
|
85
|
+
def tmp_rse_info(rse=None, vo=DEFAULT_VO, rse_id=None, session=None):
|
|
85
86
|
if rse_id is None:
|
|
86
87
|
# This can be called directly by client tools if they're co-located on a server
|
|
87
88
|
# i.e. running rucio cli on a server and during the test suite.
|
rucio/rse/protocols/ngarc.py
CHANGED
|
@@ -20,7 +20,7 @@ from rucio.rse.protocols import protocol
|
|
|
20
20
|
|
|
21
21
|
try:
|
|
22
22
|
import arc # pylint: disable=import-error
|
|
23
|
-
except:
|
|
23
|
+
except Exception:
|
|
24
24
|
pass
|
|
25
25
|
|
|
26
26
|
|
|
@@ -59,7 +59,7 @@ class Default(protocol.RSEProtocol):
|
|
|
59
59
|
self.cfg = arc.UserConfig()
|
|
60
60
|
try:
|
|
61
61
|
self.cfg.ProxyPath(os.environ['X509_USER_PROXY'])
|
|
62
|
-
except:
|
|
62
|
+
except Exception:
|
|
63
63
|
pass
|
|
64
64
|
|
|
65
65
|
def path2pfn(self, path):
|
rucio/rse/protocols/srm.py
CHANGED
rucio/rse/protocols/webdav.py
CHANGED
|
@@ -253,8 +253,15 @@ class Default(protocol.RSEProtocol):
|
|
|
253
253
|
:raise ServiceUnavailable, RSEAccessDenied
|
|
254
254
|
"""
|
|
255
255
|
path = self.path2pfn(pfn)
|
|
256
|
+
|
|
257
|
+
using_presigned_urls = self.rse['sign_url'] is not None
|
|
258
|
+
|
|
256
259
|
try:
|
|
257
|
-
|
|
260
|
+
# use GET instead of HEAD for presigned urls
|
|
261
|
+
if not using_presigned_urls:
|
|
262
|
+
result = self.session.request('HEAD', path, verify=False, timeout=self.timeout, cert=self.cert)
|
|
263
|
+
else:
|
|
264
|
+
result = self.session.request('GET', path, verify=False, timeout=self.timeout, cert=self.cert)
|
|
258
265
|
if result.status_code == 200:
|
|
259
266
|
return True
|
|
260
267
|
elif result.status_code in [401, ]:
|
rucio/rse/rsemanager.py
CHANGED
|
@@ -22,6 +22,7 @@ from urllib.parse import urlparse
|
|
|
22
22
|
from rucio.common import constants, exception, types, utils
|
|
23
23
|
from rucio.common.checksum import GLOBALLY_SUPPORTED_CHECKSUMS
|
|
24
24
|
from rucio.common.config import config_get_int
|
|
25
|
+
from rucio.common.constants import DEFAULT_VO
|
|
25
26
|
from rucio.common.constraints import STRING_TYPES
|
|
26
27
|
from rucio.common.logging import formatted_logger
|
|
27
28
|
from rucio.common.utils import get_transfer_schemas, make_valid_did
|
|
@@ -34,7 +35,7 @@ if TYPE_CHECKING:
|
|
|
34
35
|
from rucio.rse.protocols.protocol import RSEProtocol
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
def get_scope_protocol(vo: str =
|
|
38
|
+
def get_scope_protocol(vo: str = DEFAULT_VO) -> 'Callable':
|
|
38
39
|
"""
|
|
39
40
|
Returns the callable protocol to translate the pfn to a name/scope pair
|
|
40
41
|
|
|
@@ -48,7 +49,7 @@ def get_scope_protocol(vo: str = 'def') -> 'Callable':
|
|
|
48
49
|
|
|
49
50
|
def get_rse_info(
|
|
50
51
|
rse: Optional[str] = None,
|
|
51
|
-
vo: str =
|
|
52
|
+
vo: str = DEFAULT_VO,
|
|
52
53
|
rse_id: Optional[str] = None,
|
|
53
54
|
session: Optional["Session"] = None
|
|
54
55
|
) -> types.RSESettingsDict:
|
|
@@ -306,7 +307,7 @@ def exists(
|
|
|
306
307
|
scheme: Optional[str] = None,
|
|
307
308
|
impl: Optional[str] = None,
|
|
308
309
|
auth_token: Optional[str] = None,
|
|
309
|
-
vo: str =
|
|
310
|
+
vo: str = DEFAULT_VO,
|
|
310
311
|
logger: types.LoggerFunction = logging.log
|
|
311
312
|
) -> Union[bool, list[Union[bool, dict[dict[str, str], bool]]]]:
|
|
312
313
|
"""
|
|
@@ -381,7 +382,7 @@ def upload(
|
|
|
381
382
|
delete_existing: bool = False,
|
|
382
383
|
sign_service: Optional[str] = None,
|
|
383
384
|
auth_token: Optional[str] = None,
|
|
384
|
-
vo: str =
|
|
385
|
+
vo: str = DEFAULT_VO,
|
|
385
386
|
logger: types.LoggerFunction = logging.log,
|
|
386
387
|
impl: Optional[str] = None
|
|
387
388
|
) -> dict[Union[int, str], Union[bool, str, dict[str, Union[Literal[True], Exception]]]]:
|
rucio/rse/translation.py
CHANGED
|
@@ -18,7 +18,7 @@ from configparser import NoOptionError, NoSectionError
|
|
|
18
18
|
from typing import TYPE_CHECKING, Any, Optional
|
|
19
19
|
|
|
20
20
|
from rucio.common import config
|
|
21
|
-
from rucio.common.constants import RseAttr
|
|
21
|
+
from rucio.common.constants import DEFAULT_VO, RseAttr
|
|
22
22
|
from rucio.common.exception import ConfigNotFound
|
|
23
23
|
from rucio.common.plugins import PolicyPackageAlgorithms
|
|
24
24
|
|
|
@@ -35,7 +35,7 @@ class RSEDeterministicScopeTranslation(PolicyPackageAlgorithms):
|
|
|
35
35
|
|
|
36
36
|
_algorithm_type = "pfn2lfn"
|
|
37
37
|
|
|
38
|
-
def __init__(self, vo: str =
|
|
38
|
+
def __init__(self, vo: str = DEFAULT_VO):
|
|
39
39
|
super().__init__()
|
|
40
40
|
|
|
41
41
|
logger = logging.getLogger(__name__)
|
rucio/tests/common.py
CHANGED
|
@@ -28,6 +28,7 @@ import pytest
|
|
|
28
28
|
import requests
|
|
29
29
|
|
|
30
30
|
from rucio.common.config import config_get, config_get_bool, get_config_dirs
|
|
31
|
+
from rucio.common.constants import DEFAULT_VO
|
|
31
32
|
from rucio.common.utils import execute
|
|
32
33
|
from rucio.common.utils import generate_uuid as uuid
|
|
33
34
|
|
|
@@ -77,7 +78,7 @@ def get_long_vo() -> str:
|
|
|
77
78
|
Don't map the name to a short version.
|
|
78
79
|
:returns: VO name string.
|
|
79
80
|
"""
|
|
80
|
-
vo_name =
|
|
81
|
+
vo_name = DEFAULT_VO
|
|
81
82
|
if config_get_bool('common', 'multi_vo', raise_exception=False, default=False):
|
|
82
83
|
vo = config_get('client', 'vo', raise_exception=False, default=None)
|
|
83
84
|
if vo is not None:
|
|
@@ -102,13 +103,13 @@ def scope_name_generator() -> str:
|
|
|
102
103
|
|
|
103
104
|
|
|
104
105
|
def did_name_generator(did_type: str = 'file', name_prefix: str = '', name_suffix: str = '', path: Optional[str] = None) -> str:
|
|
105
|
-
""" Generate random
|
|
106
|
+
""" Generate random DID name.
|
|
106
107
|
:param did_type: A string to create a meaningful did_name depending on the did_type (file, dataset, container)
|
|
107
|
-
:param name_prefix: String to prefix to the
|
|
108
|
-
:param name_suffix: String to append to the
|
|
108
|
+
:param name_prefix: String to prefix to the DID name
|
|
109
|
+
:param name_suffix: String to append to the DID name
|
|
109
110
|
:param path: If specified, use the path to generate the did_name
|
|
110
111
|
|
|
111
|
-
:returns: A random
|
|
112
|
+
:returns: A random DID name
|
|
112
113
|
"""
|
|
113
114
|
if os.getenv('POLICY') == 'belleii':
|
|
114
115
|
if path is not None:
|
rucio/vcsversion.py
CHANGED
|
@@ -4,8 +4,8 @@ This file is automatically generated; Do not edit it. :)
|
|
|
4
4
|
'''
|
|
5
5
|
VERSION_INFO = {
|
|
6
6
|
'final': True,
|
|
7
|
-
'version': '37.
|
|
7
|
+
'version': '37.7.0',
|
|
8
8
|
'branch_nick': 'release-37',
|
|
9
|
-
'revision_id': '
|
|
10
|
-
'revno':
|
|
9
|
+
'revision_id': '61ed028cbd532ede88189a81bee971db566fcdec',
|
|
10
|
+
'revno': 13826
|
|
11
11
|
}
|
|
@@ -72,7 +72,7 @@ class LocalAccountLimit(ErrorHandlingMethodView):
|
|
|
72
72
|
parameters = json_parameters()
|
|
73
73
|
bytes_param = param_get(parameters, 'bytes')
|
|
74
74
|
try:
|
|
75
|
-
set_local_account_limit(account=account, rse=rse, bytes_=bytes_param, issuer=request.environ
|
|
75
|
+
set_local_account_limit(account=account, rse=rse, bytes_=bytes_param, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
76
76
|
except AccessDenied as error:
|
|
77
77
|
return generate_http_error_flask(401, error)
|
|
78
78
|
except (RSENotFound, AccountNotFound) as error:
|
|
@@ -108,7 +108,7 @@ class LocalAccountLimit(ErrorHandlingMethodView):
|
|
|
108
108
|
description: "No RSE or account found for the given id."
|
|
109
109
|
"""
|
|
110
110
|
try:
|
|
111
|
-
delete_local_account_limit(account=account, rse=rse, issuer=request.environ
|
|
111
|
+
delete_local_account_limit(account=account, rse=rse, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
112
112
|
except AccessDenied as error:
|
|
113
113
|
return generate_http_error_flask(401, error)
|
|
114
114
|
except (AccountNotFound, RSENotFound) as error:
|
|
@@ -168,8 +168,8 @@ class GlobalAccountLimit(ErrorHandlingMethodView):
|
|
|
168
168
|
account=account,
|
|
169
169
|
rse_expression=rse_expression,
|
|
170
170
|
bytes_=bytes_param,
|
|
171
|
-
issuer=request.environ
|
|
172
|
-
vo=request.environ
|
|
171
|
+
issuer=request.environ['issuer'],
|
|
172
|
+
vo=request.environ['vo'],
|
|
173
173
|
)
|
|
174
174
|
except AccessDenied as error:
|
|
175
175
|
return generate_http_error_flask(401, error)
|
|
@@ -206,7 +206,7 @@ class GlobalAccountLimit(ErrorHandlingMethodView):
|
|
|
206
206
|
description: "No RSE or account found for the given id."
|
|
207
207
|
"""
|
|
208
208
|
try:
|
|
209
|
-
delete_global_account_limit(account=account, rse_expression=rse_expression, issuer=request.environ
|
|
209
|
+
delete_global_account_limit(account=account, rse_expression=rse_expression, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
210
210
|
except AccessDenied as error:
|
|
211
211
|
return generate_http_error_flask(401, error)
|
|
212
212
|
except (AccountNotFound, RSENotFound) as error:
|
|
@@ -76,7 +76,7 @@ class Attributes(ErrorHandlingMethodView):
|
|
|
76
76
|
description: "Not acceptable."
|
|
77
77
|
"""
|
|
78
78
|
try:
|
|
79
|
-
attribs = list_account_attributes(account, vo=request.environ
|
|
79
|
+
attribs = list_account_attributes(account, vo=request.environ['vo'])
|
|
80
80
|
except AccountNotFound as error:
|
|
81
81
|
return generate_http_error_flask(404, error)
|
|
82
82
|
|
|
@@ -134,7 +134,7 @@ class Attributes(ErrorHandlingMethodView):
|
|
|
134
134
|
parameters = json_parameters()
|
|
135
135
|
value = param_get(parameters, 'value')
|
|
136
136
|
try:
|
|
137
|
-
add_account_attribute(key=key, value=value, account=account, issuer=request.environ
|
|
137
|
+
add_account_attribute(key=key, value=value, account=account, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
138
138
|
except AccessDenied as error:
|
|
139
139
|
return generate_http_error_flask(401, error)
|
|
140
140
|
except Duplicate as error:
|
|
@@ -173,7 +173,7 @@ class Attributes(ErrorHandlingMethodView):
|
|
|
173
173
|
description: "No account found for the given id."
|
|
174
174
|
"""
|
|
175
175
|
try:
|
|
176
|
-
del_account_attribute(account=account, key=key, issuer=request.environ
|
|
176
|
+
del_account_attribute(account=account, key=key, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
177
177
|
except AccessDenied as error:
|
|
178
178
|
return generate_http_error_flask(401, error)
|
|
179
179
|
except AccountNotFound as error:
|
|
@@ -333,10 +333,10 @@ class AccountParameter(ErrorHandlingMethodView):
|
|
|
333
333
|
frontend = request.headers.get('X-Requested-Host', default=None)
|
|
334
334
|
if frontend:
|
|
335
335
|
return redirect(f'{frontend}/accounts/{request.environ.get("issuer")}', code=302)
|
|
336
|
-
return redirect(request.environ
|
|
336
|
+
return redirect(request.environ['issuer'], code=303)
|
|
337
337
|
|
|
338
338
|
try:
|
|
339
|
-
acc = get_account_info(account, vo=request.environ
|
|
339
|
+
acc = get_account_info(account, vo=request.environ['vo'])
|
|
340
340
|
except AccountNotFound as error:
|
|
341
341
|
return generate_http_error_flask(404, error)
|
|
342
342
|
except AccessDenied as error:
|
|
@@ -383,7 +383,7 @@ class AccountParameter(ErrorHandlingMethodView):
|
|
|
383
383
|
parameters = json_parameters()
|
|
384
384
|
for key, value in parameters.items():
|
|
385
385
|
try:
|
|
386
|
-
update_account(account, key=key, value=value, issuer=request.environ
|
|
386
|
+
update_account(account, key=key, value=value, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
387
387
|
except ValueError:
|
|
388
388
|
return generate_http_error_flask(400, ValueError.__name__, f'Unknown value {value}')
|
|
389
389
|
except AccessDenied as error:
|
|
@@ -442,7 +442,7 @@ class AccountParameter(ErrorHandlingMethodView):
|
|
|
442
442
|
type_param = param_get(parameters, 'type')
|
|
443
443
|
email = param_get(parameters, 'email')
|
|
444
444
|
try:
|
|
445
|
-
add_account(account, type_param, email, issuer=request.environ
|
|
445
|
+
add_account(account, type_param, email, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
446
446
|
except Duplicate as error:
|
|
447
447
|
return generate_http_error_flask(409, error)
|
|
448
448
|
except AccessDenied as error:
|
|
@@ -475,7 +475,7 @@ class AccountParameter(ErrorHandlingMethodView):
|
|
|
475
475
|
description: "Account not found"
|
|
476
476
|
"""
|
|
477
477
|
try:
|
|
478
|
-
del_account(account, issuer=request.environ
|
|
478
|
+
del_account(account, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
479
479
|
except AccessDenied as error:
|
|
480
480
|
return generate_http_error_flask(401, error)
|
|
481
481
|
except AccountNotFound as error:
|
|
@@ -520,7 +520,7 @@ class Account(ErrorHandlingMethodView):
|
|
|
520
520
|
for account in list_accounts(filter_=_filter, vo=vo):
|
|
521
521
|
yield render_json(**account) + "\n"
|
|
522
522
|
|
|
523
|
-
return try_stream(generate(_filter=dict(request.args.items(multi=False)), vo=request.environ
|
|
523
|
+
return try_stream(generate(_filter=dict(request.args.items(multi=False)), vo=request.environ['vo']))
|
|
524
524
|
|
|
525
525
|
|
|
526
526
|
class LocalAccountLimits(ErrorHandlingMethodView):
|
|
@@ -561,7 +561,7 @@ class LocalAccountLimits(ErrorHandlingMethodView):
|
|
|
561
561
|
description: "Not Acceptable"
|
|
562
562
|
"""
|
|
563
563
|
try:
|
|
564
|
-
limits = get_local_account_limit(account=account, rse=rse, vo=request.environ
|
|
564
|
+
limits = get_local_account_limit(account=account, rse=rse, vo=request.environ['vo'])
|
|
565
565
|
except RSENotFound as error:
|
|
566
566
|
return generate_http_error_flask(404, error)
|
|
567
567
|
|
|
@@ -606,7 +606,7 @@ class GlobalAccountLimits(ErrorHandlingMethodView):
|
|
|
606
606
|
description: "Not Acceptable"
|
|
607
607
|
"""
|
|
608
608
|
try:
|
|
609
|
-
limits = get_global_account_limit(account=account, rse_expression=rse_expression, vo=request.environ
|
|
609
|
+
limits = get_global_account_limit(account=account, rse_expression=rse_expression, vo=request.environ['vo'])
|
|
610
610
|
except RSENotFound as error:
|
|
611
611
|
return generate_http_error_flask(404, error)
|
|
612
612
|
|
|
@@ -677,8 +677,8 @@ class Identities(ErrorHandlingMethodView):
|
|
|
677
677
|
authtype = param_get(parameters, 'authtype')
|
|
678
678
|
email = param_get(parameters, 'email')
|
|
679
679
|
|
|
680
|
-
issuer = request.environ
|
|
681
|
-
vo = request.environ
|
|
680
|
+
issuer = request.environ['issuer']
|
|
681
|
+
vo = request.environ['vo']
|
|
682
682
|
|
|
683
683
|
if not issuer or not vo:
|
|
684
684
|
return generate_http_error_flask(400, ValueError.__name__, 'Issuer and VO must be set.')
|
|
@@ -745,7 +745,7 @@ class Identities(ErrorHandlingMethodView):
|
|
|
745
745
|
for identity in list_identities(account, vo=vo):
|
|
746
746
|
yield render_json(**identity) + "\n"
|
|
747
747
|
|
|
748
|
-
return try_stream(generate(request.environ
|
|
748
|
+
return try_stream(generate(request.environ['vo']))
|
|
749
749
|
except AccountNotFound as error:
|
|
750
750
|
return generate_http_error_flask(404, error)
|
|
751
751
|
|
|
@@ -790,8 +790,8 @@ class Identities(ErrorHandlingMethodView):
|
|
|
790
790
|
identity = param_get(parameters, 'identity')
|
|
791
791
|
authtype = param_get(parameters, 'authtype')
|
|
792
792
|
|
|
793
|
-
issuer = request.environ
|
|
794
|
-
vo = request.environ
|
|
793
|
+
issuer = request.environ['issuer']
|
|
794
|
+
vo = request.environ['vo']
|
|
795
795
|
|
|
796
796
|
if not issuer or not vo:
|
|
797
797
|
return generate_http_error_flask(400, ValueError.__name__, 'Issuer and VO must be set.')
|
|
@@ -846,7 +846,7 @@ class Rules(ErrorHandlingMethodView):
|
|
|
846
846
|
for rule in list_replication_rules(filters=filters, vo=vo):
|
|
847
847
|
yield dumps(rule, cls=APIEncoder) + '\n'
|
|
848
848
|
|
|
849
|
-
return try_stream(generate(vo=request.environ
|
|
849
|
+
return try_stream(generate(vo=request.environ['vo']))
|
|
850
850
|
except RuleNotFound as error:
|
|
851
851
|
return generate_http_error_flask(404, error)
|
|
852
852
|
|
|
@@ -901,7 +901,7 @@ class UsageHistory(ErrorHandlingMethodView):
|
|
|
901
901
|
description: "Not acceptable"
|
|
902
902
|
"""
|
|
903
903
|
try:
|
|
904
|
-
usage = get_usage_history(account=account, rse=rse, issuer=request.environ
|
|
904
|
+
usage = get_usage_history(account=account, rse=rse, issuer=request.environ['issuer'], vo=request.environ['vo'])
|
|
905
905
|
except (AccountNotFound, CounterNotFound) as error:
|
|
906
906
|
return generate_http_error_flask(404, error)
|
|
907
907
|
except AccessDenied as error:
|
|
@@ -972,7 +972,7 @@ class LocalUsage(ErrorHandlingMethodView):
|
|
|
972
972
|
for usage in get_local_account_usage(account=account, rse=rse, issuer=issuer, vo=vo):
|
|
973
973
|
yield dumps(usage, cls=APIEncoder) + '\n'
|
|
974
974
|
|
|
975
|
-
return try_stream(generate(issuer=request.environ
|
|
975
|
+
return try_stream(generate(issuer=request.environ['issuer'], vo=request.environ['vo']))
|
|
976
976
|
except (AccountNotFound, RSENotFound) as error:
|
|
977
977
|
return generate_http_error_flask(404, error)
|
|
978
978
|
except AccessDenied as error:
|
|
@@ -1036,7 +1036,7 @@ class GlobalUsage(ErrorHandlingMethodView):
|
|
|
1036
1036
|
for usage in get_global_account_usage(account=account, rse_expression=rse_expression, issuer=issuer, vo=vo):
|
|
1037
1037
|
yield dumps(usage, cls=APIEncoder) + '\n'
|
|
1038
1038
|
|
|
1039
|
-
return try_stream(generate(vo=request.environ
|
|
1039
|
+
return try_stream(generate(vo=request.environ['vo'], issuer=request.environ['issuer']))
|
|
1040
1040
|
except (AccountNotFound, RSENotFound) as error:
|
|
1041
1041
|
return generate_http_error_flask(404, error)
|
|
1042
1042
|
except AccessDenied as error:
|
|
@@ -17,6 +17,7 @@ from typing import TYPE_CHECKING
|
|
|
17
17
|
|
|
18
18
|
from flask import Flask, Response, request
|
|
19
19
|
|
|
20
|
+
from rucio.common.constants import DEFAULT_VO
|
|
20
21
|
from rucio.gateway.did import list_archive_content
|
|
21
22
|
from rucio.web.rest.flaskapi.authenticated_bp import AuthenticatedBlueprint
|
|
22
23
|
from rucio.web.rest.flaskapi.v1.common import ErrorHandlingMethodView, check_accept_header_wrapper_flask, generate_http_error_flask, parse_scope_name, response_headers, try_stream
|
|
@@ -54,10 +55,10 @@ class Archive(ErrorHandlingMethodView):
|
|
|
54
55
|
type: object
|
|
55
56
|
properties:
|
|
56
57
|
scope:
|
|
57
|
-
description: "The scope of the
|
|
58
|
+
description: "The scope of the DID."
|
|
58
59
|
type: string
|
|
59
60
|
name:
|
|
60
|
-
description: "The name of the
|
|
61
|
+
description: "The name of the DID."
|
|
61
62
|
type: string
|
|
62
63
|
bytes:
|
|
63
64
|
description: "The number of bytes."
|
|
@@ -80,7 +81,7 @@ class Archive(ErrorHandlingMethodView):
|
|
|
80
81
|
for file in list_archive_content(scope=scope, name=name, vo=vo):
|
|
81
82
|
yield dumps(file) + '\n'
|
|
82
83
|
|
|
83
|
-
return try_stream(generate(vo=request.environ.get('vo',
|
|
84
|
+
return try_stream(generate(vo=request.environ.get('vo', DEFAULT_VO)))
|
|
84
85
|
except ValueError as error:
|
|
85
86
|
return generate_http_error_flask(400, error)
|
|
86
87
|
|
|
@@ -30,6 +30,7 @@ from werkzeug.exceptions import HTTPException
|
|
|
30
30
|
from werkzeug.wrappers import Request, Response
|
|
31
31
|
|
|
32
32
|
from rucio.common import config
|
|
33
|
+
from rucio.common.constants import DEFAULT_VO
|
|
33
34
|
from rucio.common.exception import CannotAuthenticate, DatabaseException, IdentityError, RucioException, UnsupportedRequestedContentType
|
|
34
35
|
from rucio.common.schema import get_schema_value
|
|
35
36
|
from rucio.common.utils import generate_uuid, render_json
|
|
@@ -161,7 +162,7 @@ def request_auth_env() -> Optional['ResponseReturnValue']:
|
|
|
161
162
|
logging.exception('Internal error in validate_auth_token')
|
|
162
163
|
return 'Internal Error', 500
|
|
163
164
|
|
|
164
|
-
flask.request.environ['vo'] = auth.get('vo',
|
|
165
|
+
flask.request.environ['vo'] = auth.get('vo', DEFAULT_VO)
|
|
165
166
|
flask.request.environ['issuer'] = auth.get('account')
|
|
166
167
|
flask.request.environ['identity'] = auth.get('identity')
|
|
167
168
|
flask.request.environ['request_id'] = generate_uuid()
|
|
@@ -232,9 +233,9 @@ def parse_scope_name(scope_name: str, vo: Optional[str]) -> tuple[str, ...]:
|
|
|
232
233
|
return scope, name
|
|
233
234
|
|
|
234
235
|
if not vo:
|
|
235
|
-
vo =
|
|
236
|
+
vo = DEFAULT_VO
|
|
236
237
|
|
|
237
|
-
# The ':' in
|
|
238
|
+
# The ':' in DID is replaced by '/', also an '/' is added. Why?
|
|
238
239
|
pattern = get_schema_value('SCOPE_NAME_REGEXP', vo)
|
|
239
240
|
text = '/' + scope_name
|
|
240
241
|
|
|
@@ -413,7 +414,7 @@ def extract_vo(headers: Headers) -> str:
|
|
|
413
414
|
:returns: a string containing the short VO name.
|
|
414
415
|
"""
|
|
415
416
|
try:
|
|
416
|
-
return map_vo(headers.get('X-Rucio-VO', default=
|
|
417
|
+
return map_vo(headers.get('X-Rucio-VO', default=DEFAULT_VO))
|
|
417
418
|
except RucioException as err:
|
|
418
419
|
# VO Name doesn't match allowed spec
|
|
419
420
|
flask.abort(generate_http_error_flask(status_code=400, exc=err))
|