rucio 35.7.0__py3-none-any.whl → 37.0.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 (266) hide show
  1. rucio/alembicrevision.py +1 -1
  2. rucio/{daemons/c3po/collectors → cli}/__init__.py +1 -0
  3. rucio/cli/account.py +216 -0
  4. rucio-35.7.0.data/scripts/rucio → rucio/cli/bin_legacy/rucio.py +769 -486
  5. rucio-35.7.0.data/scripts/rucio-admin → rucio/cli/bin_legacy/rucio_admin.py +476 -423
  6. rucio/cli/command.py +272 -0
  7. rucio/cli/config.py +72 -0
  8. rucio/cli/did.py +191 -0
  9. rucio/cli/download.py +128 -0
  10. rucio/cli/lifetime_exception.py +33 -0
  11. rucio/cli/replica.py +162 -0
  12. rucio/cli/rse.py +293 -0
  13. rucio/cli/rule.py +158 -0
  14. rucio/cli/scope.py +40 -0
  15. rucio/cli/subscription.py +73 -0
  16. rucio/cli/upload.py +60 -0
  17. rucio/cli/utils.py +226 -0
  18. rucio/client/accountclient.py +0 -1
  19. rucio/client/baseclient.py +33 -24
  20. rucio/client/client.py +45 -1
  21. rucio/client/didclient.py +5 -3
  22. rucio/client/downloadclient.py +6 -8
  23. rucio/client/replicaclient.py +0 -2
  24. rucio/client/richclient.py +317 -0
  25. rucio/client/rseclient.py +4 -4
  26. rucio/client/uploadclient.py +26 -12
  27. rucio/common/bittorrent.py +234 -0
  28. rucio/common/cache.py +66 -29
  29. rucio/common/checksum.py +168 -0
  30. rucio/common/client.py +122 -0
  31. rucio/common/config.py +22 -35
  32. rucio/common/constants.py +61 -3
  33. rucio/common/didtype.py +72 -24
  34. rucio/common/dumper/__init__.py +45 -38
  35. rucio/common/dumper/consistency.py +75 -30
  36. rucio/common/dumper/data_models.py +63 -19
  37. rucio/common/dumper/path_parsing.py +19 -8
  38. rucio/common/exception.py +65 -8
  39. rucio/common/extra.py +5 -10
  40. rucio/common/logging.py +13 -13
  41. rucio/common/pcache.py +8 -7
  42. rucio/common/plugins.py +59 -27
  43. rucio/common/policy.py +12 -3
  44. rucio/common/schema/__init__.py +84 -34
  45. rucio/common/schema/generic.py +0 -17
  46. rucio/common/schema/generic_multi_vo.py +0 -17
  47. rucio/common/test_rucio_server.py +12 -6
  48. rucio/common/types.py +132 -52
  49. rucio/common/utils.py +93 -643
  50. rucio/core/account_limit.py +14 -12
  51. rucio/core/authentication.py +2 -2
  52. rucio/core/config.py +23 -42
  53. rucio/core/credential.py +14 -15
  54. rucio/core/did.py +5 -1
  55. rucio/core/did_meta_plugins/elasticsearch_meta.py +407 -0
  56. rucio/core/did_meta_plugins/filter_engine.py +62 -3
  57. rucio/core/did_meta_plugins/json_meta.py +2 -2
  58. rucio/core/did_meta_plugins/mongo_meta.py +43 -30
  59. rucio/core/did_meta_plugins/postgres_meta.py +75 -39
  60. rucio/core/identity.py +6 -5
  61. rucio/core/importer.py +4 -3
  62. rucio/core/lifetime_exception.py +2 -2
  63. rucio/core/lock.py +8 -7
  64. rucio/core/message.py +6 -0
  65. rucio/core/monitor.py +30 -29
  66. rucio/core/naming_convention.py +2 -2
  67. rucio/core/nongrid_trace.py +2 -2
  68. rucio/core/oidc.py +11 -9
  69. rucio/core/permission/__init__.py +79 -37
  70. rucio/core/permission/generic.py +1 -7
  71. rucio/core/permission/generic_multi_vo.py +1 -7
  72. rucio/core/quarantined_replica.py +4 -3
  73. rucio/core/replica.py +464 -139
  74. rucio/core/replica_sorter.py +55 -59
  75. rucio/core/request.py +34 -32
  76. rucio/core/rse.py +301 -97
  77. rucio/core/rse_counter.py +1 -2
  78. rucio/core/rse_expression_parser.py +7 -7
  79. rucio/core/rse_selector.py +9 -7
  80. rucio/core/rule.py +41 -40
  81. rucio/core/rule_grouping.py +42 -40
  82. rucio/core/scope.py +5 -4
  83. rucio/core/subscription.py +26 -28
  84. rucio/core/topology.py +11 -11
  85. rucio/core/trace.py +2 -2
  86. rucio/core/transfer.py +29 -15
  87. rucio/core/volatile_replica.py +4 -3
  88. rucio/daemons/atropos/atropos.py +1 -1
  89. rucio/daemons/auditor/__init__.py +2 -2
  90. rucio/daemons/auditor/srmdumps.py +6 -6
  91. rucio/daemons/automatix/automatix.py +32 -21
  92. rucio/daemons/badreplicas/necromancer.py +2 -2
  93. rucio/daemons/bb8/nuclei_background_rebalance.py +1 -1
  94. rucio/daemons/bb8/t2_background_rebalance.py +1 -1
  95. rucio/daemons/common.py +15 -25
  96. rucio/daemons/conveyor/finisher.py +2 -2
  97. rucio/daemons/conveyor/poller.py +18 -28
  98. rucio/daemons/conveyor/receiver.py +2 -2
  99. rucio/daemons/conveyor/stager.py +1 -0
  100. rucio/daemons/conveyor/submitter.py +3 -3
  101. rucio/daemons/hermes/hermes.py +91 -30
  102. rucio/daemons/judge/evaluator.py +2 -2
  103. rucio/daemons/oauthmanager/oauthmanager.py +3 -3
  104. rucio/daemons/reaper/dark_reaper.py +7 -3
  105. rucio/daemons/reaper/reaper.py +12 -16
  106. rucio/daemons/rsedecommissioner/config.py +1 -1
  107. rucio/daemons/rsedecommissioner/profiles/generic.py +5 -4
  108. rucio/daemons/rsedecommissioner/profiles/types.py +7 -6
  109. rucio/daemons/rsedecommissioner/rse_decommissioner.py +1 -1
  110. rucio/daemons/storage/consistency/actions.py +8 -6
  111. rucio/daemons/tracer/kronos.py +4 -4
  112. rucio/db/sqla/constants.py +5 -0
  113. rucio/db/sqla/migrate_repo/versions/1677d4d803c8_split_rse_availability_into_multiple.py +4 -4
  114. rucio/db/sqla/migrate_repo/versions/30d5206e9cad_increase_oauthrequest_redirect_msg_.py +37 -0
  115. rucio/db/sqla/models.py +157 -154
  116. rucio/db/sqla/session.py +58 -27
  117. rucio/db/sqla/types.py +2 -2
  118. rucio/db/sqla/util.py +2 -2
  119. rucio/gateway/account.py +18 -12
  120. rucio/gateway/account_limit.py +137 -60
  121. rucio/gateway/authentication.py +18 -12
  122. rucio/gateway/config.py +30 -20
  123. rucio/gateway/credential.py +9 -10
  124. rucio/gateway/did.py +70 -53
  125. rucio/gateway/dirac.py +6 -4
  126. rucio/gateway/exporter.py +3 -2
  127. rucio/gateway/heartbeat.py +6 -4
  128. rucio/gateway/identity.py +36 -51
  129. rucio/gateway/importer.py +3 -2
  130. rucio/gateway/lifetime_exception.py +3 -2
  131. rucio/gateway/meta_conventions.py +17 -6
  132. rucio/gateway/permission.py +4 -1
  133. rucio/gateway/quarantined_replica.py +3 -2
  134. rucio/gateway/replica.py +31 -22
  135. rucio/gateway/request.py +27 -18
  136. rucio/gateway/rse.py +69 -37
  137. rucio/gateway/rule.py +46 -26
  138. rucio/gateway/scope.py +3 -2
  139. rucio/gateway/subscription.py +14 -11
  140. rucio/gateway/vo.py +12 -8
  141. rucio/rse/__init__.py +3 -3
  142. rucio/rse/protocols/bittorrent.py +11 -1
  143. rucio/rse/protocols/cache.py +0 -11
  144. rucio/rse/protocols/dummy.py +0 -11
  145. rucio/rse/protocols/gfal.py +14 -9
  146. rucio/rse/protocols/globus.py +1 -1
  147. rucio/rse/protocols/http_cache.py +1 -1
  148. rucio/rse/protocols/posix.py +2 -2
  149. rucio/rse/protocols/protocol.py +84 -317
  150. rucio/rse/protocols/rclone.py +2 -1
  151. rucio/rse/protocols/rfio.py +10 -1
  152. rucio/rse/protocols/ssh.py +2 -1
  153. rucio/rse/protocols/storm.py +2 -13
  154. rucio/rse/protocols/webdav.py +74 -30
  155. rucio/rse/protocols/xrootd.py +2 -1
  156. rucio/rse/rsemanager.py +170 -53
  157. rucio/rse/translation.py +260 -0
  158. rucio/tests/common.py +23 -13
  159. rucio/tests/common_server.py +26 -9
  160. rucio/transfertool/bittorrent.py +15 -14
  161. rucio/transfertool/bittorrent_driver.py +5 -7
  162. rucio/transfertool/bittorrent_driver_qbittorrent.py +9 -8
  163. rucio/transfertool/fts3.py +20 -16
  164. rucio/transfertool/mock.py +2 -3
  165. rucio/vcsversion.py +4 -4
  166. rucio/version.py +7 -0
  167. rucio/web/rest/flaskapi/v1/accounts.py +17 -3
  168. rucio/web/rest/flaskapi/v1/auth.py +5 -5
  169. rucio/web/rest/flaskapi/v1/credentials.py +3 -2
  170. rucio/web/rest/flaskapi/v1/dids.py +21 -15
  171. rucio/web/rest/flaskapi/v1/identities.py +33 -9
  172. rucio/web/rest/flaskapi/v1/redirect.py +5 -4
  173. rucio/web/rest/flaskapi/v1/replicas.py +12 -8
  174. rucio/web/rest/flaskapi/v1/rses.py +15 -4
  175. rucio/web/rest/flaskapi/v1/traces.py +56 -19
  176. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/alembic.ini.template +1 -1
  177. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/alembic_offline.ini.template +1 -1
  178. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rucio.cfg.atlas.client.template +3 -2
  179. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rucio.cfg.template +3 -19
  180. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rucio_multi_vo.cfg.template +1 -18
  181. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/requirements.server.txt +97 -68
  182. rucio-37.0.0.data/scripts/rucio +133 -0
  183. rucio-37.0.0.data/scripts/rucio-admin +97 -0
  184. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-atropos +2 -2
  185. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-auditor +2 -1
  186. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-automatix +2 -2
  187. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-cache-client +17 -10
  188. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-receiver +1 -0
  189. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-kronos +1 -0
  190. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-minos +2 -2
  191. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-minos-temporary-expiration +2 -2
  192. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-necromancer +2 -2
  193. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-reaper +6 -6
  194. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-transmogrifier +2 -2
  195. rucio-37.0.0.dist-info/METADATA +92 -0
  196. {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/RECORD +237 -243
  197. {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/licenses/AUTHORS.rst +3 -0
  198. rucio/common/schema/atlas.py +0 -413
  199. rucio/common/schema/belleii.py +0 -408
  200. rucio/common/schema/domatpc.py +0 -401
  201. rucio/common/schema/escape.py +0 -426
  202. rucio/common/schema/icecube.py +0 -406
  203. rucio/core/permission/atlas.py +0 -1348
  204. rucio/core/permission/belleii.py +0 -1077
  205. rucio/core/permission/escape.py +0 -1078
  206. rucio/daemons/c3po/algorithms/__init__.py +0 -13
  207. rucio/daemons/c3po/algorithms/simple.py +0 -134
  208. rucio/daemons/c3po/algorithms/t2_free_space.py +0 -128
  209. rucio/daemons/c3po/algorithms/t2_free_space_only_pop.py +0 -130
  210. rucio/daemons/c3po/algorithms/t2_free_space_only_pop_with_network.py +0 -294
  211. rucio/daemons/c3po/c3po.py +0 -371
  212. rucio/daemons/c3po/collectors/agis.py +0 -108
  213. rucio/daemons/c3po/collectors/free_space.py +0 -81
  214. rucio/daemons/c3po/collectors/jedi_did.py +0 -57
  215. rucio/daemons/c3po/collectors/mock_did.py +0 -51
  216. rucio/daemons/c3po/collectors/network_metrics.py +0 -71
  217. rucio/daemons/c3po/collectors/workload.py +0 -112
  218. rucio/daemons/c3po/utils/__init__.py +0 -13
  219. rucio/daemons/c3po/utils/dataset_cache.py +0 -50
  220. rucio/daemons/c3po/utils/expiring_dataset_cache.py +0 -56
  221. rucio/daemons/c3po/utils/expiring_list.py +0 -62
  222. rucio/daemons/c3po/utils/popularity.py +0 -85
  223. rucio/daemons/c3po/utils/timeseries.py +0 -89
  224. rucio/rse/protocols/gsiftp.py +0 -92
  225. rucio-35.7.0.data/scripts/rucio-c3po +0 -85
  226. rucio-35.7.0.dist-info/METADATA +0 -72
  227. /rucio/{daemons/c3po → cli/bin_legacy}/__init__.py +0 -0
  228. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/globus-config.yml.template +0 -0
  229. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/ldap.cfg.template +0 -0
  230. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_approval_request.tmpl +0 -0
  231. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_approved_admin.tmpl +0 -0
  232. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_approved_user.tmpl +0 -0
  233. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_denied_admin.tmpl +0 -0
  234. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_denied_user.tmpl +0 -0
  235. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/mail_templates/rule_ok_notification.tmpl +0 -0
  236. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/etc/rse-accounts.cfg.template +0 -0
  237. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/tools/bootstrap.py +0 -0
  238. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/tools/merge_rucio_configs.py +0 -0
  239. {rucio-35.7.0.data → rucio-37.0.0.data}/data/rucio/tools/reset_database.py +0 -0
  240. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-abacus-account +0 -0
  241. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-abacus-collection-replica +0 -0
  242. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-abacus-rse +0 -0
  243. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-bb8 +0 -0
  244. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-cache-consumer +0 -0
  245. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-finisher +0 -0
  246. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-poller +0 -0
  247. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-preparer +0 -0
  248. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-stager +0 -0
  249. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-submitter +0 -0
  250. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-conveyor-throttler +0 -0
  251. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-dark-reaper +0 -0
  252. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-dumper +0 -0
  253. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-follower +0 -0
  254. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-hermes +0 -0
  255. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-cleaner +0 -0
  256. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-evaluator +0 -0
  257. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-injector +0 -0
  258. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-judge-repairer +0 -0
  259. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-oauth-manager +0 -0
  260. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-replica-recoverer +0 -0
  261. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-rse-decommissioner +0 -0
  262. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-storage-consistency-actions +0 -0
  263. {rucio-35.7.0.data → rucio-37.0.0.data}/scripts/rucio-undertaker +0 -0
  264. {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/WHEEL +0 -0
  265. {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/licenses/LICENSE +0 -0
  266. {rucio-35.7.0.dist-info → rucio-37.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,133 @@
1
+ #!python
2
+ # Copyright European Organization for Nuclear Research (CERN) since 2012
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import argparse
17
+ import sys
18
+ from typing import TYPE_CHECKING, Optional
19
+
20
+ from rucio.cli.bin_legacy.rucio import main as main_legacy
21
+ from rucio.cli.command import main
22
+ from rucio.common.utils import setup_logger
23
+
24
+ if TYPE_CHECKING:
25
+ from logging import Logger
26
+
27
+
28
+ def _get_first_command(args: list[str]) -> Optional[str]:
29
+ return next(
30
+ (
31
+ arg for arg in args
32
+ if arg != 'rucio' and (arg[0] != "-" or arg in ("-h", "--help", "--version"))
33
+ ),
34
+ None
35
+ )
36
+
37
+
38
+ def make_warning(logger: "Logger") -> None:
39
+ base_warning = "This method is being deprecated."
40
+ new_command = map_legacy_command()
41
+ if new_command is not None:
42
+ warning = f"{base_warning} Please replace your command with `rucio {' '.join(new_command)}`"
43
+ else:
44
+ warning = base_warning + " Please view rucio -h for an updated help menu."
45
+
46
+ logger.warning(warning)
47
+
48
+
49
+ def map_legacy_command() -> Optional[list[str]]:
50
+ command = _get_first_command(sys.argv[1:])
51
+
52
+ new_command = None
53
+ if command not in ("-h", "--version", None):
54
+ command_map = {
55
+ "list-file-replicas": ["replica", "list", "file"],
56
+ "list-dataset-replicas": ["replica", "list", "dataset"],
57
+ "add-dataset": ["did", "add", "--type dataset"],
58
+ "add-container": ["did", "add", "--type container"],
59
+ "attach": ["did", "content", "add"],
60
+ "detach": ["did", "content", "remove"],
61
+ "ls": ["did", "list"],
62
+ "list-dids": ["did", "list"],
63
+ "list-parent-dids": ["did", "list", "--parent"],
64
+ "list-scopes": ["scope", "list"],
65
+ "close": ["did", "update", "--close"],
66
+ "reopen": ["did", "update", "--open"],
67
+ "stat": ["did", "show"],
68
+ "erase": ["did", "remove"],
69
+ "list-content": ["did", "content", "list"],
70
+ "list-content-history": ["did", "content", "history"],
71
+ "upload": ["upload"],
72
+ "get": ["download"],
73
+ "download": ["download"],
74
+ "get-metadata": ["did", "metadata", "list"],
75
+ "set-metadata": ["did", "metadata", "add"],
76
+ "delete-metadata": ["did", "metadata", "remove"],
77
+ "list-rse-usage": ["rse", "show"],
78
+ "list-account-usage": ["account", "limit", "list"],
79
+ "list-account-limits": ["account", "limit", "list"],
80
+ "add-rule": ["rule", "add"],
81
+ "delete-rule": ["rule", "remove"],
82
+ "rule-info": ["rule", "show"],
83
+ "list-rules": ["rule", "list"],
84
+ "list-rules-history": ["rule", "history"],
85
+ "update-rule": ["rule", "update"],
86
+ "move-rule": ["rule", "move"],
87
+ "list-rses": ["rse", "list"],
88
+ "list-suspicious-replicas": ["replica", "state", "suspicious"],
89
+ "list-rse-attributes": ["rse", "attribute", "list"],
90
+ "touch": ["did", "update", "--touch"],
91
+ "add-lifetime-exception": ["lifetime-exception", "add"],
92
+ }
93
+ new_command = command_map.get(command)
94
+
95
+ return new_command
96
+
97
+
98
+ if __name__ == "__main__":
99
+ commands = ("account", "config", "did", "replica", "rse", "rule", "scope", "subscription", "ping", "whoami", "test-server", "lifetime-exception", "upload", "download")
100
+
101
+ parser = argparse.ArgumentParser(add_help=False)
102
+ # Check for legacy flag
103
+ parser.add_argument("--legacy", action="store_true")
104
+ # Check for commands in the new command list
105
+ parser.add_argument("-h", "--help", action="store_true")
106
+ parser.add_argument("--version", action="store_true")
107
+
108
+ args, _ = parser.parse_known_args()
109
+
110
+ logger = setup_logger(module_name=__name__)
111
+
112
+ if args.legacy:
113
+ make_warning(logger)
114
+ sys.argv.pop(sys.argv.index('--legacy'))
115
+ main_legacy()
116
+
117
+ elif (any(arg in commands for arg in sys.argv)) or args.help or args.version:
118
+ main() # pylint: disable=E1120
119
+
120
+ else:
121
+ make_warning(logger)
122
+ try:
123
+ main_legacy()
124
+ # Make a custom warning - show the new help menu when invalid commands are called.
125
+ except argparse.ArgumentError:
126
+ logger.error("Invalid argument(s) - %s " % sys.argv[1:])
127
+ command = map_legacy_command()
128
+ if command is not None:
129
+ sys.argv = ["rucio"] + command + ["-h"]
130
+ else:
131
+ sys.argv = ["rucio", "-h"]
132
+
133
+ main() # pylint: disable=E1120
@@ -0,0 +1,97 @@
1
+ #!python
2
+ # Copyright European Organization for Nuclear Research (CERN) since 2012
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import sys
17
+
18
+ from rucio.cli.bin_legacy.rucio_admin import main as main_legacy
19
+ from rucio.common.utils import setup_logger
20
+
21
+
22
+ def make_warning():
23
+ logger = setup_logger(module_name=__name__)
24
+
25
+ base_warning = "This method is being deprecated."
26
+ args = [arg for arg in sys.argv if arg[0] != "-" or arg in ("-h", "--help", "--version")]
27
+ try:
28
+ first_command = args[1]
29
+ except IndexError:
30
+ first_command = None
31
+ try:
32
+ second_command = args[2]
33
+ except IndexError:
34
+ second_command = "-h"
35
+
36
+ if (first_command not in ("-h", "--version", "--help")) and (first_command is not None):
37
+ command_map = {
38
+ "data": {"import": "upload", "export": "download"},
39
+ "account": {
40
+ "-h": "account -h",
41
+ "add": "account add",
42
+ "delete": "account remove",
43
+ "info": "account show",
44
+ "update": "account update",
45
+ "set-limits": "account limit add",
46
+ "get-limits": "account limit list",
47
+ "delete-limits": "account limit remove",
48
+ "ban": "account update --ban",
49
+ "unban": "account update --unban",
50
+ "list-attributes": "account attribute list",
51
+ "add-attribute": "account attribute add",
52
+ "delete-attribute": "account attribute remove",
53
+ },
54
+ "identity": {"-h": "account identity -h", "add": "account identity add", "delete": "account identity remove"},
55
+ "rse": {
56
+ "-h": "rse -h",
57
+ "add": "rse add",
58
+ "list": "rse list",
59
+ "update": "rse update",
60
+ "info": "rse show",
61
+ "set-attribute": "rse attribute add",
62
+ "delete-attribute": "rse attribute remove",
63
+ "delete-distance": "rse distance remove",
64
+ "get-distance": "rse distance show",
65
+ "set-distance": "rse distance update",
66
+ "get-attribute": "rse attribute list",
67
+ "add-protocol": "rse protocol add",
68
+ "delete-protocol": "rse protocol remove",
69
+ "delete": "rse remove",
70
+ "add-qos-policy": "rse qos add",
71
+ "add-distance": "rse distance add",
72
+ "delete-qos-policy": "rse qos remove",
73
+ "list-qos-policies": "rse qos list",
74
+ "set-limit": "rse limit add",
75
+ "delete-limit": "rse limit remove",
76
+ },
77
+ "scope": {"-h": "scope -h", "add": "scope add", "list": "scope list"},
78
+ "config": {"-h": "config -h", "get": "config list", "set": "config add", "delete": "config remove"},
79
+ "subscription": {"-h": "subscription -h", "add": "subscription add", "list": "subscription", "update": "subscription update", "reevaluate": "subscription touch"},
80
+ "replicas": {"-h": "replica -h", "quarantine": "replica state update quarantine", "declare-bad": "replica state update bad", "declare-temporary-unavailable": "replica state update unavailable", "set-tombstone": "replica remove"},
81
+ }
82
+ try:
83
+ new_command = command_map[first_command]
84
+ new_command = new_command[second_command]
85
+ except KeyError:
86
+ new_command = "-h"
87
+
88
+ warning = f"{base_warning} Please replace your command with `rucio {new_command}`"
89
+ else:
90
+ warning = base_warning + " Please view rucio -h for an updated help menu."
91
+
92
+ logger.warning(warning)
93
+
94
+
95
+ if __name__ == "__main__":
96
+ make_warning()
97
+ main_legacy()
@@ -13,9 +13,9 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- '''
16
+ """
17
17
  Atropos Daemon : End the life of the rules according to the Lifetime Model
18
- '''
18
+ """
19
19
 
20
20
  import argparse
21
21
  import datetime
@@ -32,6 +32,8 @@ import rucio.daemons.auditor
32
32
  from rucio.client.rseclient import RSEClient
33
33
  from rucio.common.exception import RSENotFound
34
34
 
35
+ RETRY_AFTER = 60 * 60 * 24 * 14 # Two weeks
36
+
35
37
 
36
38
  def setup_pipe_logger(pipe, loglevel):
37
39
  logger = logging.getLogger('auditor')
@@ -47,7 +49,6 @@ def setup_pipe_logger(pipe, loglevel):
47
49
 
48
50
 
49
51
  def main(args):
50
- RETRY_AFTER = 60 * 60 * 24 * 14 # Two weeks
51
52
 
52
53
  nprocs = args.nprocs
53
54
  if nprocs < 1:
@@ -13,9 +13,9 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- '''
16
+ """
17
17
  Automatix (Dataset injector) Daemon
18
- '''
18
+ """
19
19
 
20
20
  import argparse
21
21
  import signal
@@ -14,7 +14,7 @@
14
14
  # limitations under the License.
15
15
 
16
16
  """
17
- Rucio Cache client.
17
+ Rucio Cache client.
18
18
  """
19
19
 
20
20
  import argparse
@@ -29,7 +29,7 @@ from jsonschema import validate
29
29
 
30
30
  from rucio.client.didclient import DIDClient
31
31
  from rucio.client.rseclient import RSEClient
32
- from rucio.common.config import config_get, config_get_int
32
+ from rucio.common.config import config_get_items, config_has_section
33
33
  from rucio.common.exception import DataIdentifierNotFound
34
34
  from rucio.common.schema import get_schema_value
35
35
 
@@ -104,17 +104,24 @@ def get_parser():
104
104
  'operation': 'delete_replicas'
105
105
  }
106
106
  """
107
- oparser = argparse.ArgumentParser(description="This daemons is used to populate information of replicas on volatile storage.",
108
- prog=os.path.basename(sys.argv[0]), add_help=True)
107
+ description = "This daemon is used to populate information of replicas on volatile storage."
108
+
109
+ if not config_has_section("message-cache"):
110
+ defaults = {}
111
+ message_append = "WARNING: section 'messaging-cache' not present in config! All arguments must be manually set!\n"
112
+ description = message_append + description
113
+ else:
114
+ defaults = config_get_items("message-cache")
115
+
116
+ oparser = argparse.ArgumentParser(description=description, prog=os.path.basename(sys.argv[0]), add_help=True)
109
117
 
110
118
  # Main arguments
111
- oparser.add_argument('-b', '--broker', dest='broker', default=config_get('messaging-cache', 'brokers').split(',')[0], help='Message broker name')
112
- oparser.add_argument('-p', '--port', dest='port', default=config_get_int('messaging-cache', 'port'), help='Message broker port')
113
- oparser.add_argument('-c', '--certificate', dest='ssl_cert_file', default=config_get('messaging-cache', 'ssl_cert_file'), help='Certificate file')
114
- oparser.add_argument('-k', '--certificate-key', dest='ssl_key_file', default=config_get('messaging-cache', 'ssl_key_file'), help='Certificate key file')
115
- oparser.add_argument('-d', '--destination', dest='destination', default=config_get('messaging-cache', 'destination'), help="Message broker topic")
119
+ oparser.add_argument('-b', '--broker', dest='broker', default=defaults.get('brokers', '').split(',')[0], help='Message broker name')
120
+ oparser.add_argument('-p', '--port', dest='port', type=int, default=defaults.get('port'), help='Message broker port')
121
+ oparser.add_argument('-c', '--certificate', dest='ssl_cert_file', default=defaults.get('ssl_cert_file'), help='Certificate file')
122
+ oparser.add_argument('-k', '--certificate-key', dest='ssl_key_file', default=defaults.get('ssl_key_file'), help='Certificate key file')
123
+ oparser.add_argument('-d', '--destination', dest='destination', default=defaults.get('destination'), help="Message broker topic")
116
124
  oparser.add_argument('-m', '--message', dest='message', default=None, help=message_help)
117
-
118
125
  return oparser
119
126
 
120
127
 
@@ -16,6 +16,7 @@
16
16
  """
17
17
  Conveyor is a daemon to manage file transfers.
18
18
  """
19
+
19
20
  import argparse
20
21
  import signal
21
22
 
@@ -12,6 +12,7 @@
12
12
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
+
15
16
  """
16
17
  Kronos is a daemon that consumes tracer messages and updates the replica atime accordingly.
17
18
  """
@@ -13,14 +13,14 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- '''
16
+ """
17
17
  Minos Daemon :
18
18
  Minos is the name of one of the judge on the underworld in the greek mythology.
19
19
  The role of the daemon is get as input the list of PFNs declared bad
20
20
  and to class them into 2 categories :
21
21
  - The ones temporary available
22
22
  - The ones that have a real problem and that will need to be recovered by the necromancer
23
- '''
23
+ """
24
24
 
25
25
  import argparse
26
26
  import signal
@@ -13,11 +13,11 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- '''
16
+ """
17
17
  Minos Daemon Temporary Unavailable:
18
18
  This special type of minos daemon lists the expired TEMPORARY_UNAVAILABLE replicas and
19
19
  puts them back into AVAILABLE state.
20
- '''
20
+ """
21
21
 
22
22
  import argparse
23
23
  import signal
@@ -13,9 +13,9 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- '''
16
+ """
17
17
  Necromancer Daemon : Bring the dead files back to life
18
- '''
18
+ """
19
19
 
20
20
  import argparse
21
21
  import signal
@@ -13,13 +13,13 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- '''
17
- '''
16
+ """
17
+ Reaper is a daemon to manage file deletion.
18
+ """
18
19
 
19
20
  import argparse
20
21
  import signal
21
22
 
22
- from rucio.common.utils import StoreAndDeprecateWarningAction
23
23
  from rucio.daemons.reaper.reaper import run, stop
24
24
 
25
25
 
@@ -32,7 +32,7 @@ def get_parser():
32
32
  help='Runs one loop iteration')
33
33
  parser.add_argument("--threads", action="store", default=1, type=int,
34
34
  help='Concurrency control: number of threads')
35
- parser.add_argument("--chunk_size", "--chunk-size", new_option_string="--chunk-size", action=StoreAndDeprecateWarningAction, default=100, type=int,
35
+ parser.add_argument("--chunk-size", action="store", default=100, type=int,
36
36
  help='The size used for a bulk deletion on on RSE')
37
37
  parser.add_argument('--sleep-time', action="store", default=60, type=int,
38
38
  help='Minimum time between 2 consecutive cycles')
@@ -50,9 +50,9 @@ def get_parser():
50
50
  help='The delay (seconds) to query replicas in BEING_DELETED state.')
51
51
  parser.add_argument('--scheme', action="store", default=None, type=str,
52
52
  help='Force the reaper to use a particular protocol/scheme, e.g., mock')
53
- parser.add_argument("--auto_exclude_threshold", "--auto-exclude-threshhold", new_option_string="--auto-exclude-threshhold", action=StoreAndDeprecateWarningAction, default=100, type=int,
53
+ parser.add_argument("--auto-exclude-threshold", action="store", default=100, type=int,
54
54
  help='Number of service unavailable exceptions after which the RSE gets temporarily excluded.')
55
- parser.add_argument("--auto_exclude_timeout", "--auto-exclude-timeout", new_option_string="--auto-exclude-timeout", action=StoreAndDeprecateWarningAction, default=600, type=int,
55
+ parser.add_argument("--auto-exclude-timeout", action="store", default=600, type=int,
56
56
  help='Timeout for temporarily excluded RSEs.')
57
57
 
58
58
  return parser
@@ -13,9 +13,9 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
 
16
- '''
16
+ """
17
17
  Transmogrifier (Replication Rule Resolver) Daemon
18
- '''
18
+ """
19
19
 
20
20
  import argparse
21
21
  import signal
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: rucio
3
+ Version: 37.0.0
4
+ Summary: Rucio Package
5
+ Home-page: https://rucio.cern.ch/
6
+ Author: Rucio
7
+ Author-email: rucio-dev@cern.ch
8
+ License: Apache License, Version 2.0
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Intended Audience :: Information Technology
12
+ Classifier: Intended Audience :: System Administrators
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Natural Language :: English
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Environment :: No Input/Output (Daemon)
20
+ Requires-Python: >=3.9, <4
21
+ License-File: LICENSE
22
+ License-File: AUTHORS.rst
23
+ Requires-Dist: requests
24
+ Requires-Dist: urllib3
25
+ Requires-Dist: dogpile-cache<=1.2.2
26
+ Requires-Dist: packaging
27
+ Requires-Dist: tabulate
28
+ Requires-Dist: jsonschema
29
+ Requires-Dist: dataclasses
30
+ Requires-Dist: rich
31
+ Requires-Dist: typing_extensions
32
+ Requires-Dist: argcomplete
33
+ Requires-Dist: boto
34
+ Requires-Dist: python-magic
35
+ Requires-Dist: paramiko
36
+ Requires-Dist: boto3
37
+ Requires-Dist: sqlalchemy
38
+ Requires-Dist: alembic
39
+ Requires-Dist: pymemcache
40
+ Requires-Dist: python-dateutil
41
+ Requires-Dist: stomp-py
42
+ Requires-Dist: statsd
43
+ Requires-Dist: geoip2
44
+ Requires-Dist: google-auth
45
+ Requires-Dist: redis
46
+ Requires-Dist: flask
47
+ Requires-Dist: oic
48
+ Requires-Dist: prometheus_client
49
+ Provides-Extra: oracle
50
+ Requires-Dist: cx_oracle; extra == "oracle"
51
+ Provides-Extra: mongo
52
+ Requires-Dist: pymongo; extra == "mongo"
53
+ Provides-Extra: elastic
54
+ Requires-Dist: elasticsearch; extra == "elastic"
55
+ Provides-Extra: postgresql
56
+ Requires-Dist: psycopg[binary,pool]; extra == "postgresql"
57
+ Provides-Extra: mysql
58
+ Requires-Dist: PyMySQL; extra == "mysql"
59
+ Provides-Extra: kerberos
60
+ Requires-Dist: kerberos; extra == "kerberos"
61
+ Requires-Dist: pykerberos; extra == "kerberos"
62
+ Requires-Dist: requests-kerberos; extra == "kerberos"
63
+ Provides-Extra: globus
64
+ Requires-Dist: PyYAML; extra == "globus"
65
+ Requires-Dist: globus-sdk; extra == "globus"
66
+ Provides-Extra: saml
67
+ Requires-Dist: python3-saml; extra == "saml"
68
+ Provides-Extra: dev
69
+ Requires-Dist: pytest; extra == "dev"
70
+ Requires-Dist: pytest-xdist; extra == "dev"
71
+ Requires-Dist: pytest-cov; extra == "dev"
72
+ Requires-Dist: pyflakes; extra == "dev"
73
+ Requires-Dist: flake8; extra == "dev"
74
+ Requires-Dist: pylint; extra == "dev"
75
+ Requires-Dist: isort; extra == "dev"
76
+ Requires-Dist: xmltodict; extra == "dev"
77
+ Requires-Dist: pytz; extra == "dev"
78
+ Requires-Dist: pycodestyle; extra == "dev"
79
+ Requires-Dist: pydoc-markdown; extra == "dev"
80
+ Requires-Dist: docspec_python; extra == "dev"
81
+ Requires-Dist: sh; extra == "dev"
82
+ Requires-Dist: PyYAML; extra == "dev"
83
+ Dynamic: author
84
+ Dynamic: author-email
85
+ Dynamic: classifier
86
+ Dynamic: home-page
87
+ Dynamic: license
88
+ Dynamic: license-file
89
+ Dynamic: provides-extra
90
+ Dynamic: requires-dist
91
+ Dynamic: requires-python
92
+ Dynamic: summary