rucio 37.6.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 +40 -21
- rucio/cli/rule.py +9 -5
- rucio/client/baseclient.py +4 -3
- rucio/client/downloadclient.py +2 -1
- rucio/client/exportclient.py +45 -4
- rucio/client/pingclient.py +35 -4
- rucio/client/touchclient.py +2 -1
- rucio/client/uploadclient.py +3 -2
- rucio/common/cache.py +1 -2
- rucio/common/client.py +4 -30
- rucio/common/config.py +26 -1
- rucio/common/constants.py +3 -1
- rucio/common/plugins.py +2 -2
- rucio/common/policy.py +3 -2
- rucio/common/schema/__init__.py +4 -3
- rucio/common/types.py +7 -5
- rucio/core/account.py +2 -1
- rucio/core/account_limit.py +3 -2
- rucio/core/did.py +8 -7
- rucio/core/dirac.py +2 -1
- rucio/core/distance.py +2 -1
- rucio/core/exporter.py +3 -2
- rucio/core/importer.py +5 -5
- rucio/core/permission/__init__.py +2 -1
- rucio/core/replica.py +5 -5
- rucio/core/request.py +2 -2
- rucio/core/rse.py +7 -7
- rucio/core/rule.py +8 -8
- rucio/core/transfer.py +2 -2
- rucio/core/vo.py +2 -1
- rucio/daemons/atropos/atropos.py +2 -1
- rucio/daemons/automatix/automatix.py +5 -5
- rucio/daemons/badreplicas/minos.py +3 -2
- rucio/daemons/bb8/bb8.py +2 -1
- rucio/daemons/bb8/nuclei_background_rebalance.py +2 -2
- rucio/daemons/conveyor/common.py +3 -3
- rucio/daemons/conveyor/submitter.py +2 -1
- rucio/daemons/hermes/hermes.py +27 -6
- rucio/daemons/reaper/dark_reaper.py +5 -4
- rucio/daemons/reaper/reaper.py +7 -7
- rucio/daemons/replicarecoverer/suspicious_replica_recoverer.py +3 -3
- rucio/daemons/tracer/kronos.py +3 -2
- rucio/daemons/transmogrifier/transmogrifier.py +70 -68
- rucio/daemons/undertaker/undertaker.py +2 -1
- rucio/db/sqla/models.py +2 -2
- rucio/db/sqla/util.py +3 -2
- rucio/gateway/account.py +13 -12
- 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 +32 -32
- rucio/gateway/dirac.py +2 -1
- 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 +4 -3
- 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 +18 -18
- 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/rsemanager.py +5 -4
- rucio/rse/translation.py +2 -2
- rucio/tests/common.py +2 -1
- rucio/vcsversion.py +3 -3
- rucio/web/rest/flaskapi/v1/accountlimits.py +5 -5
- rucio/web/rest/flaskapi/v1/archives.py +2 -1
- rucio/web/rest/flaskapi/v1/common.py +4 -3
- rucio/web/rest/flaskapi/v1/dids.py +205 -154
- {rucio-37.6.0.dist-info → rucio-37.7.0.dist-info}/METADATA +1 -1
- {rucio-37.6.0.dist-info → rucio-37.7.0.dist-info}/RECORD +139 -139
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/alembic.ini.template +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/alembic_offline.ini.template +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio.cfg.template +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/requirements.server.txt +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/tools/bootstrap.py +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/data/rucio/tools/reset_database.py +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-account +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-collection-replica +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-abacus-rse +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-admin +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-atropos +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-auditor +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-automatix +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-bb8 +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-cache-client +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-cache-consumer +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-finisher +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-poller +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-preparer +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-receiver +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-stager +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-submitter +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-conveyor-throttler +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-dark-reaper +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-dumper +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-follower +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-hermes +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-judge-cleaner +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-judge-evaluator +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-judge-injector +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-judge-repairer +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-kronos +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-minos +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-minos-temporary-expiration +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-necromancer +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-oauth-manager +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-reaper +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-replica-recoverer +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-rse-decommissioner +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-storage-consistency-actions +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-transmogrifier +0 -0
- {rucio-37.6.0.data → rucio-37.7.0.data}/scripts/rucio-undertaker +0 -0
- {rucio-37.6.0.dist-info → rucio-37.7.0.dist-info}/WHEEL +0 -0
- {rucio-37.6.0.dist-info → rucio-37.7.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {rucio-37.6.0.dist-info → rucio-37.7.0.dist-info}/licenses/LICENSE +0 -0
- {rucio-37.6.0.dist-info → rucio-37.7.0.dist-info}/top_level.txt +0 -0
rucio/core/did.py
CHANGED
|
@@ -28,6 +28,7 @@ import rucio.core.replica # import add_replicas
|
|
|
28
28
|
import rucio.core.rule
|
|
29
29
|
from rucio.common import exception
|
|
30
30
|
from rucio.common.config import config_get_bool, config_get_int
|
|
31
|
+
from rucio.common.constants import DEFAULT_VO
|
|
31
32
|
from rucio.common.utils import chunks, is_archive
|
|
32
33
|
from rucio.core import did_meta_plugins
|
|
33
34
|
from rucio.core.message import add_message
|
|
@@ -211,7 +212,7 @@ def add_dids(
|
|
|
211
212
|
'scope': did['scope'].external,
|
|
212
213
|
'name': did['name'],
|
|
213
214
|
'expired_at': str(expired_at) if expired_at is not None else None}
|
|
214
|
-
if account.vo !=
|
|
215
|
+
if account.vo != DEFAULT_VO:
|
|
215
216
|
message['vo'] = account.vo
|
|
216
217
|
|
|
217
218
|
add_message(event_type, message, session=session)
|
|
@@ -773,7 +774,7 @@ def __add_collections_to_container(
|
|
|
773
774
|
'childscope': c['scope'].external,
|
|
774
775
|
'childname': c['name'],
|
|
775
776
|
'childtype': chld_type}
|
|
776
|
-
if account.vo !=
|
|
777
|
+
if account.vo != DEFAULT_VO:
|
|
777
778
|
message['vo'] = account.vo
|
|
778
779
|
messages.append(message)
|
|
779
780
|
|
|
@@ -857,7 +858,7 @@ def delete_dids(
|
|
|
857
858
|
message = {'account': account.external,
|
|
858
859
|
'scope': did['scope'].external,
|
|
859
860
|
'name': did['name']}
|
|
860
|
-
if did['scope'].vo !=
|
|
861
|
+
if did['scope'].vo != DEFAULT_VO:
|
|
861
862
|
message['vo'] = did['scope'].vo
|
|
862
863
|
|
|
863
864
|
add_message('ERASE', message, session=session)
|
|
@@ -1286,7 +1287,7 @@ def detach_dids(
|
|
|
1286
1287
|
'childscope': source['scope'].external,
|
|
1287
1288
|
'childname': source['name'],
|
|
1288
1289
|
'childtype': chld_type}
|
|
1289
|
-
if scope.vo !=
|
|
1290
|
+
if scope.vo != DEFAULT_VO:
|
|
1290
1291
|
message['vo'] = scope.vo
|
|
1291
1292
|
|
|
1292
1293
|
add_message('ERASE_CNT', message, session=session)
|
|
@@ -1297,7 +1298,7 @@ def detach_dids(
|
|
|
1297
1298
|
'child_scope': source['scope'].external,
|
|
1298
1299
|
'child_name': str(source['name']),
|
|
1299
1300
|
'child_type': str(child_type)}
|
|
1300
|
-
if scope.vo !=
|
|
1301
|
+
if scope.vo != DEFAULT_VO:
|
|
1301
1302
|
message['vo'] = scope.vo
|
|
1302
1303
|
|
|
1303
1304
|
add_message('DETACH', message, session=session)
|
|
@@ -2241,7 +2242,7 @@ def set_status(
|
|
|
2241
2242
|
'bytes': values['bytes'],
|
|
2242
2243
|
'length': values['length'],
|
|
2243
2244
|
'events': values['events']}
|
|
2244
|
-
if scope.vo !=
|
|
2245
|
+
if scope.vo != DEFAULT_VO:
|
|
2245
2246
|
message['vo'] = scope.vo
|
|
2246
2247
|
|
|
2247
2248
|
add_message('CLOSE', message, session=session)
|
|
@@ -2259,7 +2260,7 @@ def set_status(
|
|
|
2259
2260
|
values['is_open'] = True
|
|
2260
2261
|
|
|
2261
2262
|
message = {'scope': scope.external, 'name': name}
|
|
2262
|
-
if scope.vo !=
|
|
2263
|
+
if scope.vo != DEFAULT_VO:
|
|
2263
2264
|
message['vo'] = scope.vo
|
|
2264
2265
|
add_message('OPEN', message, session=session)
|
|
2265
2266
|
|
rucio/core/dirac.py
CHANGED
|
@@ -21,6 +21,7 @@ from sqlalchemy import and_, select
|
|
|
21
21
|
from sqlalchemy.exc import NoResultFound
|
|
22
22
|
|
|
23
23
|
from rucio.common.config import config_get
|
|
24
|
+
from rucio.common.constants import DEFAULT_VO
|
|
24
25
|
from rucio.common.exception import ConfigNotFound, InvalidType, RucioException, UnsupportedOperation
|
|
25
26
|
from rucio.common.types import InternalAccount, InternalScope
|
|
26
27
|
from rucio.common.utils import extract_scope
|
|
@@ -74,7 +75,7 @@ def add_files(
|
|
|
74
75
|
account: str,
|
|
75
76
|
ignore_availability: bool,
|
|
76
77
|
parents_metadata: Optional[dict[str, Any]] = None,
|
|
77
|
-
vo: str =
|
|
78
|
+
vo: str = DEFAULT_VO,
|
|
78
79
|
*,
|
|
79
80
|
session: "Session"
|
|
80
81
|
) -> None:
|
rucio/core/distance.py
CHANGED
|
@@ -19,6 +19,7 @@ from sqlalchemy.exc import DatabaseError, IntegrityError
|
|
|
19
19
|
from sqlalchemy.orm import aliased
|
|
20
20
|
|
|
21
21
|
from rucio.common import exception
|
|
22
|
+
from rucio.common.constants import DEFAULT_VO
|
|
22
23
|
from rucio.db.sqla.models import RSE, Distance
|
|
23
24
|
from rucio.db.sqla.session import read_session, transactional_session
|
|
24
25
|
|
|
@@ -147,7 +148,7 @@ def list_distances(filter_: Optional[dict[str, Any]] = None, *, session: "Sessio
|
|
|
147
148
|
|
|
148
149
|
|
|
149
150
|
@read_session
|
|
150
|
-
def export_distances(vo: str =
|
|
151
|
+
def export_distances(vo: str = DEFAULT_VO, *, session: "Session") -> dict[str, Any]:
|
|
151
152
|
"""
|
|
152
153
|
Export distances between all the RSEs using RSE ids.
|
|
153
154
|
:param vo: The VO to export.
|
rucio/core/exporter.py
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
from typing import TYPE_CHECKING, Any
|
|
16
16
|
|
|
17
|
+
from rucio.common.constants import DEFAULT_VO
|
|
17
18
|
from rucio.core import distance as distance_module
|
|
18
19
|
from rucio.core import rse as rse_module
|
|
19
20
|
from rucio.db.sqla.session import transactional_session
|
|
@@ -23,7 +24,7 @@ if TYPE_CHECKING:
|
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
@transactional_session
|
|
26
|
-
def export_rses(vo: str =
|
|
27
|
+
def export_rses(vo: str = DEFAULT_VO, *, session: "Session") -> dict[str, dict[str, Any]]:
|
|
27
28
|
"""
|
|
28
29
|
Export RSE data.
|
|
29
30
|
|
|
@@ -39,7 +40,7 @@ def export_rses(vo: str = 'def', *, session: "Session") -> dict[str, dict[str, A
|
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
@transactional_session
|
|
42
|
-
def export_data(vo: str =
|
|
43
|
+
def export_data(vo: str = DEFAULT_VO, distance: bool = True, *, session: "Session") -> dict[str, Any]:
|
|
43
44
|
"""
|
|
44
45
|
Export data.
|
|
45
46
|
|
rucio/core/importer.py
CHANGED
|
@@ -17,7 +17,7 @@ from typing import TYPE_CHECKING, Any
|
|
|
17
17
|
from sqlalchemy import select
|
|
18
18
|
|
|
19
19
|
from rucio.common.config import config_get
|
|
20
|
-
from rucio.common.constants import RseAttr
|
|
20
|
+
from rucio.common.constants import DEFAULT_VO, RseAttr
|
|
21
21
|
from rucio.common.exception import RSEOperationNotSupported
|
|
22
22
|
from rucio.common.types import InternalAccount
|
|
23
23
|
from rucio.core import account as account_module
|
|
@@ -35,7 +35,7 @@ if TYPE_CHECKING:
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
@transactional_session
|
|
38
|
-
def import_rses(rses: dict[str, dict[str, Any]], rse_sync_method: str = 'edit', attr_sync_method: str = 'edit', protocol_sync_method: str = 'edit', vo: str =
|
|
38
|
+
def import_rses(rses: dict[str, dict[str, Any]], rse_sync_method: str = 'edit', attr_sync_method: str = 'edit', protocol_sync_method: str = 'edit', vo: str = DEFAULT_VO, *, session: "Session") -> None:
|
|
39
39
|
new_rses = []
|
|
40
40
|
for rse_name in rses:
|
|
41
41
|
rse = rses[rse_name]
|
|
@@ -143,7 +143,7 @@ def import_rses(rses: dict[str, dict[str, Any]], rse_sync_method: str = 'edit',
|
|
|
143
143
|
|
|
144
144
|
|
|
145
145
|
@transactional_session
|
|
146
|
-
def import_distances(distances, vo: str =
|
|
146
|
+
def import_distances(distances, vo: str = DEFAULT_VO, *, session: "Session") -> None:
|
|
147
147
|
for src_rse_name in distances:
|
|
148
148
|
src = rse_module.get_rse_id(rse=src_rse_name, vo=vo, session=session)
|
|
149
149
|
for dest_rse_name in distances[src_rse_name]:
|
|
@@ -192,7 +192,7 @@ def import_identities(identities: 'Iterable[dict[str, Any]]', account_name: str,
|
|
|
192
192
|
|
|
193
193
|
|
|
194
194
|
@transactional_session
|
|
195
|
-
def import_accounts(accounts: 'Iterable[dict[str, Any]]', vo: str =
|
|
195
|
+
def import_accounts(accounts: 'Iterable[dict[str, Any]]', vo: str = DEFAULT_VO, *, session: "Session") -> None:
|
|
196
196
|
vo_filter = {'account': InternalAccount(account='*', vo=vo)}
|
|
197
197
|
old_accounts = {account['account']: account for account in account_module.list_accounts(filter_=vo_filter, session=session)}
|
|
198
198
|
missing_accounts = [account for account in accounts if account['account'] not in old_accounts]
|
|
@@ -234,7 +234,7 @@ def import_accounts(accounts: 'Iterable[dict[str, Any]]', vo: str = 'def', *, se
|
|
|
234
234
|
|
|
235
235
|
|
|
236
236
|
@transactional_session
|
|
237
|
-
def import_data(data: dict[str, Any], vo: str =
|
|
237
|
+
def import_data(data: dict[str, Any], vo: str = DEFAULT_VO, *, session: "Session") -> None:
|
|
238
238
|
"""
|
|
239
239
|
Import data to add and update records in Rucio.
|
|
240
240
|
|
|
@@ -20,6 +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.constants import DEFAULT_VO
|
|
23
24
|
from rucio.common.plugins import check_policy_module_version
|
|
24
25
|
from rucio.common.policy import get_policy
|
|
25
26
|
|
|
@@ -80,7 +81,7 @@ if not multivo:
|
|
|
80
81
|
except ImportError:
|
|
81
82
|
raise exception.ErrorLoadingPolicyPackage(policy)
|
|
82
83
|
|
|
83
|
-
permission_modules[
|
|
84
|
+
permission_modules[DEFAULT_VO] = module
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
def load_permission_for_vo(vo: str) -> None:
|
rucio/core/replica.py
CHANGED
|
@@ -41,7 +41,7 @@ import rucio.core.lock
|
|
|
41
41
|
from rucio.common import exception
|
|
42
42
|
from rucio.common.cache import MemcacheRegion
|
|
43
43
|
from rucio.common.config import config_get, config_get_bool
|
|
44
|
-
from rucio.common.constants import RseAttr, SuspiciousAvailability
|
|
44
|
+
from rucio.common.constants import DEFAULT_VO, RseAttr, SuspiciousAvailability
|
|
45
45
|
from rucio.common.types import InternalAccount, InternalScope, IPDict, LFNDict, is_str_list
|
|
46
46
|
from rucio.common.utils import add_url_query, chunks, clean_pfns, str_to_date
|
|
47
47
|
from rucio.core.credential import get_signed_url
|
|
@@ -249,7 +249,7 @@ def list_bad_replicas_status(
|
|
|
249
249
|
older_than: Optional[datetime] = None,
|
|
250
250
|
limit: Optional[int] = None,
|
|
251
251
|
list_pfns: Optional[bool] = False,
|
|
252
|
-
vo: str =
|
|
252
|
+
vo: str = DEFAULT_VO,
|
|
253
253
|
*,
|
|
254
254
|
session: "Session"
|
|
255
255
|
) -> list[dict[str, Any]]:
|
|
@@ -536,7 +536,7 @@ def declare_bad_file_replicas(
|
|
|
536
536
|
@read_session
|
|
537
537
|
def get_pfn_to_rse(
|
|
538
538
|
pfns: "Iterable[str]",
|
|
539
|
-
vo: str =
|
|
539
|
+
vo: str = DEFAULT_VO,
|
|
540
540
|
*,
|
|
541
541
|
session: "Session"
|
|
542
542
|
) -> tuple[Optional[str], dict[str, Any], dict[str, list[str]]]:
|
|
@@ -711,7 +711,7 @@ def list_bad_replicas(
|
|
|
711
711
|
def get_did_from_pfns(
|
|
712
712
|
pfns: "Iterable[str]",
|
|
713
713
|
rse_id: Optional[str] = None,
|
|
714
|
-
vo: str =
|
|
714
|
+
vo: str = DEFAULT_VO,
|
|
715
715
|
*,
|
|
716
716
|
session: "Session"
|
|
717
717
|
) -> 'Iterator[dict[str, dict[str, Any]]]':
|
|
@@ -1450,7 +1450,7 @@ def list_replicas(
|
|
|
1450
1450
|
if dids:
|
|
1451
1451
|
filter_ = {'vo': dids[0]['scope'].vo}
|
|
1452
1452
|
else:
|
|
1453
|
-
filter_ = {'vo':
|
|
1453
|
+
filter_ = {'vo': DEFAULT_VO}
|
|
1454
1454
|
|
|
1455
1455
|
dids = {(did['scope'], did['name']): did for did in dids} # type: ignore (Deduplicate input)
|
|
1456
1456
|
if not dids:
|
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, TransferLimitDirection
|
|
34
|
+
from rucio.common.constants import DEFAULT_VO, 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
|
|
@@ -2918,7 +2918,7 @@ def add_monitor_message(
|
|
|
2918
2918
|
if not message.get('vo') and request.get('source_rse_id'):
|
|
2919
2919
|
src_id = request['source_rse_id']
|
|
2920
2920
|
vo = get_rse_vo(rse_id=src_id, session=session)
|
|
2921
|
-
if vo !=
|
|
2921
|
+
if vo != DEFAULT_VO:
|
|
2922
2922
|
message['vo'] = vo
|
|
2923
2923
|
for time_field in ('created_at', 'submitted_at', 'started_at', 'transferred_at'):
|
|
2924
2924
|
field_value = message[time_field]
|
rucio/core/rse.py
CHANGED
|
@@ -29,7 +29,7 @@ from rucio.common import exception, types, utils
|
|
|
29
29
|
from rucio.common.cache import MemcacheRegion
|
|
30
30
|
from rucio.common.checksum import CHECKSUM_KEY, GLOBALLY_SUPPORTED_CHECKSUMS
|
|
31
31
|
from rucio.common.config import get_lfn2pfn_algorithm_default
|
|
32
|
-
from rucio.common.constants import RSE_ALL_SUPPORTED_PROTOCOL_OPERATIONS, RSE_ATTRS_BOOL, RSE_ATTRS_STR, SUPPORTED_SIGN_URL_SERVICES_LITERAL, RseAttr
|
|
32
|
+
from rucio.common.constants import DEFAULT_VO, RSE_ALL_SUPPORTED_PROTOCOL_OPERATIONS, RSE_ATTRS_BOOL, RSE_ATTRS_STR, SUPPORTED_SIGN_URL_SERVICES_LITERAL, RseAttr
|
|
33
33
|
from rucio.common.utils import Availability
|
|
34
34
|
from rucio.core.rse_counter import add_counter, get_counter
|
|
35
35
|
from rucio.db.sqla import models
|
|
@@ -415,7 +415,7 @@ def _group_query_result_by_rse_id(
|
|
|
415
415
|
@transactional_session
|
|
416
416
|
def add_rse(
|
|
417
417
|
rse: str,
|
|
418
|
-
vo: str =
|
|
418
|
+
vo: str = DEFAULT_VO,
|
|
419
419
|
deterministic: bool = True,
|
|
420
420
|
volatile: bool = False,
|
|
421
421
|
city: Optional[str] = None,
|
|
@@ -497,7 +497,7 @@ def add_rse(
|
|
|
497
497
|
@read_session
|
|
498
498
|
def rse_exists(
|
|
499
499
|
rse: str,
|
|
500
|
-
vo: str =
|
|
500
|
+
vo: str = DEFAULT_VO,
|
|
501
501
|
include_deleted: bool = False,
|
|
502
502
|
*,
|
|
503
503
|
session: "Session"
|
|
@@ -662,7 +662,7 @@ def get_rse(
|
|
|
662
662
|
@read_session
|
|
663
663
|
def get_rse_id(
|
|
664
664
|
rse: str,
|
|
665
|
-
vo: str =
|
|
665
|
+
vo: str = DEFAULT_VO,
|
|
666
666
|
include_deleted: bool = True,
|
|
667
667
|
*,
|
|
668
668
|
session: "Session"
|
|
@@ -680,7 +680,7 @@ def get_rse_id(
|
|
|
680
680
|
"""
|
|
681
681
|
|
|
682
682
|
if include_deleted:
|
|
683
|
-
if vo !=
|
|
683
|
+
if vo != DEFAULT_VO:
|
|
684
684
|
cache_key = 'rse-id_{}@{}'.format(rse, vo).replace(' ', '.')
|
|
685
685
|
else:
|
|
686
686
|
cache_key = 'rse-id_{}'.format(rse).replace(' ', '.')
|
|
@@ -1035,7 +1035,7 @@ def get_rses_with_attribute(
|
|
|
1035
1035
|
def get_rses_with_attribute_value(
|
|
1036
1036
|
key: str,
|
|
1037
1037
|
value: Union[bool, str],
|
|
1038
|
-
vo: str =
|
|
1038
|
+
vo: str = DEFAULT_VO,
|
|
1039
1039
|
*,
|
|
1040
1040
|
session: "Session"
|
|
1041
1041
|
) -> list[dict[str, str]]:
|
|
@@ -1048,7 +1048,7 @@ def get_rses_with_attribute_value(
|
|
|
1048
1048
|
|
|
1049
1049
|
:returns: List of rse dictionaries with the rse_id and rse_name
|
|
1050
1050
|
"""
|
|
1051
|
-
if vo !=
|
|
1051
|
+
if vo != DEFAULT_VO:
|
|
1052
1052
|
cache_key = 'av-%s-%s@%s' % (key, value, vo)
|
|
1053
1053
|
else:
|
|
1054
1054
|
cache_key = 'av-%s-%s' % (key, value)
|
rucio/core/rule.py
CHANGED
|
@@ -37,7 +37,7 @@ import rucio.core.lock # import get_replica_locks, get_files_and_replica_locks_
|
|
|
37
37
|
import rucio.core.replica # import get_and_lock_file_replicas, get_and_lock_file_replicas_for_dataset
|
|
38
38
|
from rucio.common.cache import MemcacheRegion
|
|
39
39
|
from rucio.common.config import config_get
|
|
40
|
-
from rucio.common.constants import RseAttr
|
|
40
|
+
from rucio.common.constants import DEFAULT_VO, RseAttr
|
|
41
41
|
from rucio.common.exception import (
|
|
42
42
|
DataIdentifierNotFound,
|
|
43
43
|
DuplicateRule,
|
|
@@ -2510,7 +2510,7 @@ def update_rules_for_lost_replica(
|
|
|
2510
2510
|
'name': name,
|
|
2511
2511
|
'dataset_name': dts['name'],
|
|
2512
2512
|
'dataset_scope': dts['scope'].external}
|
|
2513
|
-
if scope.vo !=
|
|
2513
|
+
if scope.vo != DEFAULT_VO:
|
|
2514
2514
|
message['vo'] = scope.vo
|
|
2515
2515
|
|
|
2516
2516
|
add_message('LOST', message, session=session)
|
|
@@ -2675,7 +2675,7 @@ def generate_rule_notifications(
|
|
|
2675
2675
|
payload = {'scope': rule.scope.external,
|
|
2676
2676
|
'name': rule.name,
|
|
2677
2677
|
'rule_id': rule.id}
|
|
2678
|
-
if rule.scope.vo !=
|
|
2678
|
+
if rule.scope.vo != DEFAULT_VO:
|
|
2679
2679
|
payload['vo'] = rule.scope.vo
|
|
2680
2680
|
|
|
2681
2681
|
add_message(event_type='RULE_OK', payload=payload, session=session)
|
|
@@ -2687,7 +2687,7 @@ def generate_rule_notifications(
|
|
|
2687
2687
|
payload = {'scope': rule.scope.external,
|
|
2688
2688
|
'name': rule.name,
|
|
2689
2689
|
'rule_id': rule.id}
|
|
2690
|
-
if rule.scope.vo !=
|
|
2690
|
+
if rule.scope.vo != DEFAULT_VO:
|
|
2691
2691
|
payload['vo'] = rule.scope.vo
|
|
2692
2692
|
|
|
2693
2693
|
add_message(event_type='RULE_OK', payload=payload, session=session)
|
|
@@ -2697,7 +2697,7 @@ def generate_rule_notifications(
|
|
|
2697
2697
|
'name': rule.name,
|
|
2698
2698
|
'rule_id': rule.id,
|
|
2699
2699
|
'progress': __progress_class(rule.locks_replicating_cnt, total_locks)}
|
|
2700
|
-
if rule.scope.vo !=
|
|
2700
|
+
if rule.scope.vo != DEFAULT_VO:
|
|
2701
2701
|
payload['vo'] = rule.scope.vo
|
|
2702
2702
|
|
|
2703
2703
|
add_message(event_type='RULE_PROGRESS', payload=payload, session=session)
|
|
@@ -2721,7 +2721,7 @@ def generate_rule_notifications(
|
|
|
2721
2721
|
'rse': get_rse_name(rse_id=dataset_lock.rse_id, session=session),
|
|
2722
2722
|
'rse_id': dataset_lock.rse_id,
|
|
2723
2723
|
'rule_id': rule.id}
|
|
2724
|
-
if dataset_lock.scope.vo !=
|
|
2724
|
+
if dataset_lock.scope.vo != DEFAULT_VO:
|
|
2725
2725
|
payload['vo'] = dataset_lock.scope.vo
|
|
2726
2726
|
|
|
2727
2727
|
add_message(event_type='DATASETLOCK_OK', payload=payload, session=session)
|
|
@@ -2745,7 +2745,7 @@ def generate_rule_notifications(
|
|
|
2745
2745
|
'rse': get_rse_name(rse_id=dataset_lock.rse_id, session=session),
|
|
2746
2746
|
'rse_id': dataset_lock.rse_id,
|
|
2747
2747
|
'rule_id': rule.id}
|
|
2748
|
-
if dataset_lock.scope.vo !=
|
|
2748
|
+
if dataset_lock.scope.vo != DEFAULT_VO:
|
|
2749
2749
|
payload['vo'] = dataset_lock.scope.vo
|
|
2750
2750
|
|
|
2751
2751
|
add_message(event_type='DATASETLOCK_OK', payload=payload, session=session)
|
|
@@ -2763,7 +2763,7 @@ def generate_rule_notifications(
|
|
|
2763
2763
|
'name': rule.name,
|
|
2764
2764
|
'rule_id': rule.id,
|
|
2765
2765
|
'progress': __progress_class(rule.locks_replicating_cnt, total_locks)}
|
|
2766
|
-
if rule.scope.vo !=
|
|
2766
|
+
if rule.scope.vo != DEFAULT_VO:
|
|
2767
2767
|
payload['vo'] = rule.scope.vo
|
|
2768
2768
|
|
|
2769
2769
|
add_message(event_type='RULE_PROGRESS', payload=payload, session=session)
|
rucio/core/transfer.py
CHANGED
|
@@ -28,7 +28,7 @@ from sqlalchemy import select, update
|
|
|
28
28
|
from sqlalchemy.exc import IntegrityError
|
|
29
29
|
|
|
30
30
|
from rucio.common.config import config_get, config_get_list
|
|
31
|
-
from rucio.common.constants import SUPPORTED_PROTOCOLS, RseAttr, TransferLimitDirection
|
|
31
|
+
from rucio.common.constants import DEFAULT_VO, SUPPORTED_PROTOCOLS, RseAttr, TransferLimitDirection
|
|
32
32
|
from rucio.common.exception import InvalidRSEExpression, RequestNotFound, RSEProtocolNotSupported, RucioException, UnsupportedOperation
|
|
33
33
|
from rucio.common.utils import construct_non_deterministic_pfn, get_transfer_schemas
|
|
34
34
|
from rucio.core import did
|
|
@@ -485,7 +485,7 @@ def set_transfers_state(
|
|
|
485
485
|
'external-host': external_host,
|
|
486
486
|
'queued_at': str(submitted_at),
|
|
487
487
|
'datatype': datatype}
|
|
488
|
-
if rws.scope.vo !=
|
|
488
|
+
if rws.scope.vo != DEFAULT_VO:
|
|
489
489
|
msg['vo'] = rws.scope.vo
|
|
490
490
|
|
|
491
491
|
ds_scope = transfer.rws.attributes.get('ds_scope')
|
rucio/core/vo.py
CHANGED
|
@@ -20,6 +20,7 @@ from sqlalchemy.exc import DatabaseError, IntegrityError, NoResultFound
|
|
|
20
20
|
|
|
21
21
|
from rucio.common import exception
|
|
22
22
|
from rucio.common.config import config_get, config_get_bool
|
|
23
|
+
from rucio.common.constants import DEFAULT_VO
|
|
23
24
|
from rucio.common.types import InternalAccount
|
|
24
25
|
from rucio.db.sqla import models
|
|
25
26
|
from rucio.db.sqla.constants import AccountType, IdentityType
|
|
@@ -88,7 +89,7 @@ def add_vo(vo: str, description: str, email: str, *, session: "Session") -> None
|
|
|
88
89
|
password='password', # noqa: S106
|
|
89
90
|
session=session)
|
|
90
91
|
|
|
91
|
-
for ident in list_identities(account=InternalAccount('super_root', vo=
|
|
92
|
+
for ident in list_identities(account=InternalAccount('super_root', vo=DEFAULT_VO), session=session):
|
|
92
93
|
add_account_identity(identity=ident['identity'], type_=ident['type'], account=new_root, email='', session=session)
|
|
93
94
|
|
|
94
95
|
|
rucio/daemons/atropos/atropos.py
CHANGED
|
@@ -24,6 +24,7 @@ from typing import TYPE_CHECKING
|
|
|
24
24
|
import rucio.core.lifetime_exception
|
|
25
25
|
import rucio.db.sqla.util
|
|
26
26
|
from rucio.common import exception
|
|
27
|
+
from rucio.common.constants import DEFAULT_VO
|
|
27
28
|
from rucio.common.exception import InvalidRSEExpression, RuleNotFound
|
|
28
29
|
from rucio.common.logging import setup_logging
|
|
29
30
|
from rucio.core.did import set_metadata
|
|
@@ -193,7 +194,7 @@ def run_once(
|
|
|
193
194
|
tot_size += summary[rse_id][did].get('bytes', 0)
|
|
194
195
|
vo = get_rse_vo(rse_id=rse_id)
|
|
195
196
|
logger(logging.INFO, 'For RSE %s%s %d datasets will be deleted representing %d files and %d bytes',
|
|
196
|
-
get_rse_name(rse_id=rse_id), '' if vo ==
|
|
197
|
+
get_rse_name(rse_id=rse_id), '' if vo == DEFAULT_VO else ' on VO ' + vo, tot_datasets, tot_files, tot_size)
|
|
197
198
|
|
|
198
199
|
|
|
199
200
|
def run(
|
|
@@ -31,7 +31,7 @@ from rucio.common import exception
|
|
|
31
31
|
from rucio.common.config import config_get, config_get_bool, config_get_int, config_get_list
|
|
32
32
|
from rucio.common.logging import setup_logging
|
|
33
33
|
from rucio.common.stopwatch import Stopwatch
|
|
34
|
-
from rucio.common.types import InternalScope, LoggerFunction
|
|
34
|
+
from rucio.common.types import FileToUploadDict, InternalScope, LoggerFunction
|
|
35
35
|
from rucio.common.utils import execute, generate_uuid
|
|
36
36
|
from rucio.core.monitor import MetricManager
|
|
37
37
|
from rucio.core.scope import list_scopes
|
|
@@ -214,7 +214,7 @@ def run_once(heartbeat_handler: HeartbeatHandler, inputfile: str, **_kwargs) ->
|
|
|
214
214
|
fnames = []
|
|
215
215
|
lfns = []
|
|
216
216
|
physical_fnames = []
|
|
217
|
-
|
|
217
|
+
items: list[FileToUploadDict] = []
|
|
218
218
|
for _ in range(nbfiles):
|
|
219
219
|
fname = generate_didname(metadata=metadata, dsn=dsn, did_type="file")
|
|
220
220
|
lfns.append(fname)
|
|
@@ -223,7 +223,7 @@ def run_once(heartbeat_handler: HeartbeatHandler, inputfile: str, **_kwargs) ->
|
|
|
223
223
|
physical_fnames.append(physical_fname)
|
|
224
224
|
generate_file(physical_fname, filesize, logger=logger)
|
|
225
225
|
fnames.append(fname)
|
|
226
|
-
file_ = {
|
|
226
|
+
file_: FileToUploadDict = {
|
|
227
227
|
"did_scope": scope,
|
|
228
228
|
"did_name": fname,
|
|
229
229
|
"dataset_scope": scope,
|
|
@@ -235,11 +235,11 @@ def run_once(heartbeat_handler: HeartbeatHandler, inputfile: str, **_kwargs) ->
|
|
|
235
235
|
file_["dataset_meta"] = metadata
|
|
236
236
|
if dataset_lifetime:
|
|
237
237
|
file_["dataset_meta"]["lifetime"] = dataset_lifetime
|
|
238
|
-
|
|
238
|
+
items.append(file_)
|
|
239
239
|
logger(logging.INFO, "Upload %s:%s to %s", scope, dsn, rse)
|
|
240
240
|
try:
|
|
241
241
|
upload_client = UploadClient(client)
|
|
242
|
-
ret = upload_client.upload(
|
|
242
|
+
ret = upload_client.upload(items=items)
|
|
243
243
|
if ret == 0:
|
|
244
244
|
logger(logging.INFO, "%s successfully registered on %s", dsn, rse)
|
|
245
245
|
METRICS.counter(name="addnewdataset.done").inc()
|
|
@@ -24,6 +24,7 @@ from sqlalchemy.exc import DatabaseError
|
|
|
24
24
|
|
|
25
25
|
import rucio.db.sqla.util
|
|
26
26
|
from rucio.common.config import config_get_int
|
|
27
|
+
from rucio.common.constants import DEFAULT_VO
|
|
27
28
|
from rucio.common.exception import DatabaseException, DataIdentifierNotFound, ReplicaNotFound, UnsupportedOperation
|
|
28
29
|
from rucio.common.logging import setup_logging
|
|
29
30
|
from rucio.common.utils import chunks
|
|
@@ -208,7 +209,7 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
|
|
|
208
209
|
dict_rse = __clean_unknown_replicas(pfns, vo, logger)
|
|
209
210
|
for rse_id, pfns_by_scheme in dict_rse.items():
|
|
210
211
|
rse = get_rse_name(rse_id=rse_id, session=None)
|
|
211
|
-
rse_vo_str = rse if vo ==
|
|
212
|
+
rse_vo_str = rse if vo == DEFAULT_VO else '{} on VO {}'.format(rse, vo)
|
|
212
213
|
for scheme, pfns in pfns_by_scheme.items():
|
|
213
214
|
logger(logging.DEBUG, 'Running on RSE %s with %s replicas', rse_vo_str, len(pfns))
|
|
214
215
|
tot_chunk = int(math.ceil(len(pfns) / chunk_size))
|
|
@@ -245,7 +246,7 @@ def run_once(heartbeat_handler: "HeartbeatHandler", bulk: int, **_kwargs) -> boo
|
|
|
245
246
|
for rse_id in dict_rse:
|
|
246
247
|
replicas = []
|
|
247
248
|
rse = get_rse_name(rse_id=rse_id, session=None)
|
|
248
|
-
rse_vo_str = rse if vo ==
|
|
249
|
+
rse_vo_str = rse if vo == DEFAULT_VO else '{} on VO {}'.format(rse, vo)
|
|
249
250
|
logger(logging.DEBUG, 'Running on RSE %s', rse_vo_str)
|
|
250
251
|
for rse_id, pfns_by_scheme in dict_rse.items():
|
|
251
252
|
for scheme, pfns in pfns_by_scheme.items():
|
rucio/daemons/bb8/bb8.py
CHANGED
|
@@ -23,6 +23,7 @@ import threading
|
|
|
23
23
|
from typing import TYPE_CHECKING, Optional
|
|
24
24
|
|
|
25
25
|
from rucio.common.config import config_get_float
|
|
26
|
+
from rucio.common.constants import DEFAULT_VO
|
|
26
27
|
from rucio.common.exception import InvalidRSEExpression
|
|
27
28
|
from rucio.common.logging import setup_logging
|
|
28
29
|
from rucio.core.heartbeat import list_payload_counts, sanity_check
|
|
@@ -252,7 +253,7 @@ def run_once(
|
|
|
252
253
|
if available_source_rebalance_volume > 0:
|
|
253
254
|
vo_str = (
|
|
254
255
|
" on VO {}".format(destination_rse["vo"])
|
|
255
|
-
if destination_rse["vo"] !=
|
|
256
|
+
if destination_rse["vo"] != DEFAULT_VO
|
|
256
257
|
else ""
|
|
257
258
|
)
|
|
258
259
|
if index == 0 and destination_rse["id"] in dict_locks:
|
|
@@ -18,7 +18,7 @@ This script is to be used to background rebalance ATLAS t2 datadisks
|
|
|
18
18
|
|
|
19
19
|
from sqlalchemy import and_, or_, select
|
|
20
20
|
|
|
21
|
-
from rucio.common.constants import RseAttr
|
|
21
|
+
from rucio.common.constants import DEFAULT_VO, RseAttr
|
|
22
22
|
from rucio.core.rse import get_rse_attribute, get_rse_usage
|
|
23
23
|
from rucio.core.rse_expression_parser import parse_expression
|
|
24
24
|
from rucio.daemons.bb8.common import rebalance_rse
|
|
@@ -143,7 +143,7 @@ for source_rse in rses_over_ratio:
|
|
|
143
143
|
if available_target_rebalance_volume >= available_source_rebalance_volume:
|
|
144
144
|
available_target_rebalance_volume = available_source_rebalance_volume
|
|
145
145
|
|
|
146
|
-
vo_str = 'on VO {}'.format(destination_rse['vo']) if destination_rse['vo'] !=
|
|
146
|
+
vo_str = 'on VO {}'.format(destination_rse['vo']) if destination_rse['vo'] != DEFAULT_VO else DEFAULT_VO
|
|
147
147
|
print('Rebalance %dTB from %s(%f) to %s(%f)%s' % (available_target_rebalance_volume / 1E12, source_rse['rse'], source_rse['ratio'], destination_rse['rse'], destination_rse['ratio'], vo_str))
|
|
148
148
|
expr = destination_rse['rse']
|
|
149
149
|
rebalance_rse(rse_id=source_rse['id'], max_bytes=available_target_rebalance_volume, dry_run=False, comment='Nuclei Background rebalancing', force_expression=expr)
|
rucio/daemons/conveyor/common.py
CHANGED
|
@@ -24,7 +24,7 @@ import re
|
|
|
24
24
|
from typing import TYPE_CHECKING, Any, Optional
|
|
25
25
|
|
|
26
26
|
from rucio.common.config import config_get_bool
|
|
27
|
-
from rucio.common.constants import RseAttr
|
|
27
|
+
from rucio.common.constants import DEFAULT_VO, RseAttr
|
|
28
28
|
from rucio.common.exception import DatabaseException, DuplicateFileTransferSubmission, InvalidRSEExpression, RequestNotFound, TransferToolTimeout, TransferToolWrongAnswer, VONotFound
|
|
29
29
|
from rucio.common.stopwatch import Stopwatch
|
|
30
30
|
from rucio.core import request as request_core
|
|
@@ -510,7 +510,7 @@ def get_conveyor_rses(
|
|
|
510
510
|
:param include_rses: RSEs to include
|
|
511
511
|
:param exclude_rses: RSEs to exclude
|
|
512
512
|
:param vos: VOs on which to look for RSEs. Only used in multi-VO mode.
|
|
513
|
-
If None, we either use all VOs if run from
|
|
513
|
+
If None, we either use all VOs if run from DEFAULT_VO, or the current VO otherwise.
|
|
514
514
|
:param logger: Optional decorated logger that can be passed from the calling daemons or servers.
|
|
515
515
|
:return: List of working rses
|
|
516
516
|
"""
|
|
@@ -518,7 +518,7 @@ def get_conveyor_rses(
|
|
|
518
518
|
if not multi_vo:
|
|
519
519
|
if vos:
|
|
520
520
|
logger(logging.WARNING, 'Ignoring argument vos, this is only applicable in a multi-VO setup.')
|
|
521
|
-
vos = [
|
|
521
|
+
vos = [DEFAULT_VO]
|
|
522
522
|
else:
|
|
523
523
|
if vos:
|
|
524
524
|
invalid = set(vos) - set([v['vo'] for v in list_vos()])
|
|
@@ -22,6 +22,7 @@ from typing import TYPE_CHECKING, Optional
|
|
|
22
22
|
import rucio.db.sqla.util
|
|
23
23
|
from rucio.common import exception
|
|
24
24
|
from rucio.common.config import config_get, config_get_bool, config_get_float, config_get_int, config_get_list
|
|
25
|
+
from rucio.common.constants import DEFAULT_VO
|
|
25
26
|
from rucio.common.logging import setup_logging
|
|
26
27
|
from rucio.common.schema import get_schema_value
|
|
27
28
|
from rucio.common.stopwatch import Stopwatch
|
|
@@ -370,7 +371,7 @@ def run(
|
|
|
370
371
|
if exclude_activities:
|
|
371
372
|
if not activities:
|
|
372
373
|
if not multi_vo:
|
|
373
|
-
vos = [
|
|
374
|
+
vos = [DEFAULT_VO]
|
|
374
375
|
if vos and len(vos) == 1:
|
|
375
376
|
activities = get_schema_value('ACTIVITY', vos[0])
|
|
376
377
|
elif vos and len(vos) > 1:
|
rucio/daemons/hermes/hermes.py
CHANGED
|
@@ -25,6 +25,7 @@ import random
|
|
|
25
25
|
import re
|
|
26
26
|
import smtplib
|
|
27
27
|
import socket
|
|
28
|
+
import ssl
|
|
28
29
|
import sys
|
|
29
30
|
import threading
|
|
30
31
|
import time
|
|
@@ -343,6 +344,14 @@ def deliver_emails(
|
|
|
343
344
|
:returns: List of message_id to delete
|
|
344
345
|
"""
|
|
345
346
|
|
|
347
|
+
smtp_host = config_get("messaging-hermes", "smtp_host")
|
|
348
|
+
smtp_port = config_get_int("messaging-hermes", "smtp_port", default=25)
|
|
349
|
+
smtp_username = config_get("messaging-hermes", "smtp_username", default='')
|
|
350
|
+
smtp_password = config_get("messaging-hermes", "smtp_password", default='')
|
|
351
|
+
smtp_certfile = config_get("messaging-hermes", "smtp_certfile", default='')
|
|
352
|
+
smtp_keyfile = config_get("messaging-hermes", "smtp_keyfile", default='')
|
|
353
|
+
smtp_usessl = config_get_bool("messaging-hermes", "smtp_usessl", default=False)
|
|
354
|
+
smtp_usetls = config_get_bool("messaging-hermes", "smtp_usetls", default=False)
|
|
346
355
|
email_from = config_get("messaging-hermes", "email_from")
|
|
347
356
|
send_email = config_get_bool(
|
|
348
357
|
"messaging-hermes", "send_email", raise_exception=False, default=True
|
|
@@ -357,12 +366,24 @@ def deliver_emails(
|
|
|
357
366
|
|
|
358
367
|
try:
|
|
359
368
|
if send_email:
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
369
|
+
ssl_context = None
|
|
370
|
+
if smtp_certfile and smtp_keyfile:
|
|
371
|
+
ssl_context = ssl.create_default_context()
|
|
372
|
+
ssl_context.load_cert_chain(certfile=smtp_certfile, keyfile=smtp_keyfile)
|
|
373
|
+
|
|
374
|
+
smtp_context = smtplib.SMTP(host=smtp_host, port=smtp_port)
|
|
375
|
+
if not smtp_usetls and smtp_usessl:
|
|
376
|
+
smtp_context = smtplib.SMTP_SSL(host=smtp_host, port=smtp_port, context=ssl_context)
|
|
377
|
+
|
|
378
|
+
with smtp_context as smtp_server:
|
|
379
|
+
if smtp_usetls:
|
|
380
|
+
smtp_server.ehlo() # not strictly necessary
|
|
381
|
+
smtp_server.starttls(context=ssl_context)
|
|
382
|
+
if smtp_username and smtp_password:
|
|
383
|
+
smtp_server.login(smtp_username, smtp_password)
|
|
384
|
+
smtp_server.sendmail(
|
|
385
|
+
msg["From"], message["payload"]["to"], msg.as_string()
|
|
386
|
+
)
|
|
366
387
|
to_delete.append(message["id"])
|
|
367
388
|
except Exception as error:
|
|
368
389
|
logger(logging.ERROR, "Cannot send email : %s", str(error))
|