rucio-clients 35.7.0__py3-none-any.whl → 37.0.0rc2__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-clients might be problematic. Click here for more details.

Files changed (86) hide show
  1. rucio/alembicrevision.py +1 -1
  2. rucio/cli/__init__.py +14 -0
  3. rucio/cli/account.py +216 -0
  4. rucio/cli/bin_legacy/__init__.py +13 -0
  5. rucio_clients-35.7.0.data/scripts/rucio → rucio/cli/bin_legacy/rucio.py +769 -486
  6. rucio_clients-35.7.0.data/scripts/rucio-admin → rucio/cli/bin_legacy/rucio_admin.py +476 -423
  7. rucio/cli/command.py +272 -0
  8. rucio/cli/config.py +72 -0
  9. rucio/cli/did.py +191 -0
  10. rucio/cli/download.py +128 -0
  11. rucio/cli/lifetime_exception.py +33 -0
  12. rucio/cli/replica.py +162 -0
  13. rucio/cli/rse.py +293 -0
  14. rucio/cli/rule.py +158 -0
  15. rucio/cli/scope.py +40 -0
  16. rucio/cli/subscription.py +73 -0
  17. rucio/cli/upload.py +60 -0
  18. rucio/cli/utils.py +226 -0
  19. rucio/client/accountclient.py +0 -1
  20. rucio/client/baseclient.py +33 -24
  21. rucio/client/client.py +45 -1
  22. rucio/client/didclient.py +5 -3
  23. rucio/client/downloadclient.py +6 -8
  24. rucio/client/replicaclient.py +0 -2
  25. rucio/client/richclient.py +317 -0
  26. rucio/client/rseclient.py +4 -4
  27. rucio/client/uploadclient.py +26 -12
  28. rucio/common/bittorrent.py +234 -0
  29. rucio/common/cache.py +66 -29
  30. rucio/common/checksum.py +168 -0
  31. rucio/common/client.py +122 -0
  32. rucio/common/config.py +22 -35
  33. rucio/common/constants.py +61 -3
  34. rucio/common/didtype.py +72 -24
  35. rucio/common/exception.py +65 -8
  36. rucio/common/extra.py +5 -10
  37. rucio/common/logging.py +13 -13
  38. rucio/common/pcache.py +8 -7
  39. rucio/common/plugins.py +59 -27
  40. rucio/common/policy.py +12 -3
  41. rucio/common/schema/__init__.py +84 -34
  42. rucio/common/schema/generic.py +0 -17
  43. rucio/common/schema/generic_multi_vo.py +0 -17
  44. rucio/common/stomp_utils.py +383 -119
  45. rucio/common/test_rucio_server.py +12 -6
  46. rucio/common/types.py +132 -52
  47. rucio/common/utils.py +93 -643
  48. rucio/rse/__init__.py +3 -3
  49. rucio/rse/protocols/bittorrent.py +11 -1
  50. rucio/rse/protocols/cache.py +0 -11
  51. rucio/rse/protocols/dummy.py +0 -11
  52. rucio/rse/protocols/gfal.py +14 -9
  53. rucio/rse/protocols/globus.py +1 -1
  54. rucio/rse/protocols/http_cache.py +1 -1
  55. rucio/rse/protocols/posix.py +2 -2
  56. rucio/rse/protocols/protocol.py +84 -317
  57. rucio/rse/protocols/rclone.py +2 -1
  58. rucio/rse/protocols/rfio.py +10 -1
  59. rucio/rse/protocols/ssh.py +2 -1
  60. rucio/rse/protocols/storm.py +2 -13
  61. rucio/rse/protocols/webdav.py +74 -30
  62. rucio/rse/protocols/xrootd.py +2 -1
  63. rucio/rse/rsemanager.py +170 -53
  64. rucio/rse/translation.py +260 -0
  65. rucio/vcsversion.py +4 -4
  66. rucio/version.py +7 -0
  67. {rucio_clients-35.7.0.data → rucio_clients-37.0.0rc2.data}/data/etc/rucio.cfg.atlas.client.template +3 -2
  68. {rucio_clients-35.7.0.data → rucio_clients-37.0.0rc2.data}/data/etc/rucio.cfg.template +3 -19
  69. {rucio_clients-35.7.0.data → rucio_clients-37.0.0rc2.data}/data/requirements.client.txt +11 -7
  70. rucio_clients-37.0.0rc2.data/scripts/rucio +133 -0
  71. rucio_clients-37.0.0rc2.data/scripts/rucio-admin +97 -0
  72. {rucio_clients-35.7.0.dist-info → rucio_clients-37.0.0rc2.dist-info}/METADATA +18 -14
  73. rucio_clients-37.0.0rc2.dist-info/RECORD +104 -0
  74. {rucio_clients-35.7.0.dist-info → rucio_clients-37.0.0rc2.dist-info}/licenses/AUTHORS.rst +3 -0
  75. rucio/common/schema/atlas.py +0 -413
  76. rucio/common/schema/belleii.py +0 -408
  77. rucio/common/schema/domatpc.py +0 -401
  78. rucio/common/schema/escape.py +0 -426
  79. rucio/common/schema/icecube.py +0 -406
  80. rucio/rse/protocols/gsiftp.py +0 -92
  81. rucio_clients-35.7.0.dist-info/RECORD +0 -88
  82. {rucio_clients-35.7.0.data → rucio_clients-37.0.0rc2.data}/data/etc/rse-accounts.cfg.template +0 -0
  83. {rucio_clients-35.7.0.data → rucio_clients-37.0.0rc2.data}/data/rucio_client/merge_rucio_configs.py +0 -0
  84. {rucio_clients-35.7.0.dist-info → rucio_clients-37.0.0rc2.dist-info}/WHEEL +0 -0
  85. {rucio_clients-35.7.0.dist-info → rucio_clients-37.0.0rc2.dist-info}/licenses/LICENSE +0 -0
  86. {rucio_clients-35.7.0.dist-info → rucio_clients-37.0.0rc2.dist-info}/top_level.txt +0 -0
rucio/rse/__init__.py CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  from dogpile.cache import make_region
16
16
 
17
- from rucio.common.utils import is_client
17
+ from rucio.common.client import is_client
18
18
  from rucio.rse import rsemanager
19
19
 
20
20
  if is_client():
@@ -77,7 +77,7 @@ if rsemanager.CLIENT_MODE: # pylint:disable=no-member
77
77
 
78
78
 
79
79
  if rsemanager.SERVER_MODE: # pylint:disable=no-member
80
- from rucio.common.cache import make_region_memcached
80
+ from rucio.common.cache import MemcacheRegion
81
81
  from rucio.core.rse import get_rse_id, get_rse_protocols
82
82
  from rucio.core.vo import map_vo
83
83
 
@@ -92,5 +92,5 @@ if rsemanager.SERVER_MODE: # pylint:disable=no-member
92
92
 
93
93
  setattr(rsemanager, '__request_rse_info', tmp_rse_info)
94
94
  setattr(rsemanager, '__get_signed_url', get_signed_url_server)
95
- RSE_REGION = make_region_memcached(expiration_time=900)
95
+ RSE_REGION = MemcacheRegion(expiration_time=900)
96
96
  setattr(rsemanager, 'RSE_REGION', RSE_REGION)
@@ -19,8 +19,9 @@ import time
19
19
  from urllib.parse import parse_qs, urlencode, urlparse
20
20
 
21
21
  from rucio.common import exception
22
+ from rucio.common.bittorrent import construct_torrent
22
23
  from rucio.common.extra import import_extras
23
- from rucio.common.utils import construct_torrent, resolve_ip
24
+ from rucio.common.utils import resolve_ip
24
25
  from rucio.rse import rsemanager
25
26
  from rucio.rse.protocols.protocol import RSEProtocol
26
27
 
@@ -182,3 +183,12 @@ class Default(RSEProtocol):
182
183
  time.sleep(0.25)
183
184
  finally:
184
185
  ses.remove_torrent(handle)
186
+
187
+ def delete(self, path):
188
+ raise NotImplementedError
189
+
190
+ def put(self, source, target, source_dir, transfer_timeout=None):
191
+ raise NotImplementedError
192
+
193
+ def rename(self, path, new_path):
194
+ raise NotImplementedError
@@ -49,17 +49,6 @@ class Default(protocol.RSEProtocol):
49
49
  """
50
50
  return ''.join([self.rse['scheme'], '://%s' % self.rse['hostname'], path])
51
51
 
52
- def exists(self, pfn):
53
- """ Checks if the requested file is known by the referred RSE.
54
-
55
- :param pfn: Physical file name
56
-
57
- :returns: True if the file exists, False if it doesn't
58
-
59
- :raise ServiceUnavailable
60
- """
61
- raise NotImplementedError
62
-
63
52
  def connect(self):
64
53
  """ Establishes the actual connection to the referred RSE.
65
54
 
@@ -38,17 +38,6 @@ class Default(protocol.RSEProtocol):
38
38
  """
39
39
  return ''.join([self.rse['scheme'], '://%s' % self.rse['hostname'], path])
40
40
 
41
- def exists(self, pfn):
42
- """ Checks if the requested file is known by the referred RSE.
43
-
44
- :param pfn: Physical file name
45
-
46
- :returns: True if the file exists, False if it doesn't
47
-
48
- :raise ServiceUnavailable
49
- """
50
- raise NotImplementedError
51
-
52
41
  def connect(self):
53
42
  """ Establishes the actual connection to the referred RSE.
54
43
 
@@ -22,13 +22,13 @@ import urllib.parse as urlparse
22
22
  from threading import Timer
23
23
 
24
24
  from rucio.common import config, exception
25
+ from rucio.common.checksum import GLOBALLY_SUPPORTED_CHECKSUMS, PREFERRED_CHECKSUM
25
26
  from rucio.common.constraints import STRING_TYPES
26
- from rucio.common.utils import GLOBALLY_SUPPORTED_CHECKSUMS, PREFERRED_CHECKSUM
27
27
  from rucio.rse.protocols import protocol
28
28
 
29
29
  try:
30
30
  import gfal2 # pylint: disable=import-error
31
- except:
31
+ except Exception:
32
32
  if 'RUCIO_CLIENT_MODE' not in os.environ:
33
33
  if not config.config_has_section('database'):
34
34
  raise exception.MissingDependency('Missing dependency : gfal2')
@@ -186,6 +186,7 @@ class Default(protocol.RSEProtocol):
186
186
  self.__ctx.set_opt_string_list("SRM PLUGIN", "TURL_PROTOCOLS", ["gsiftp", "rfio", "gsidcap", "dcap", "kdcap"])
187
187
  self.__ctx.set_opt_string("XROOTD PLUGIN", "XRD.WANTPROT", "gsi,unix")
188
188
  self.__ctx.set_opt_boolean("XROOTD PLUGIN", "NORMALIZE_PATH", False)
189
+ self.__ctx.set_opt_boolean("HTTP PLUGIN", "RETRIEVE_BEARER_TOKEN", False)
189
190
  auth_configured = False
190
191
  if self.auth_token:
191
192
  self.__ctx.set_opt_string("BEARER", "TOKEN", self.auth_token)
@@ -343,8 +344,13 @@ class Default(protocol.RSEProtocol):
343
344
 
344
345
  :raises SourceNotFound: if the source file was not found on the referred storage.
345
346
  """
347
+
346
348
  self.logger(logging.DEBUG, 'checking if file exists {}'.format(path))
347
349
 
350
+ if path is None:
351
+ # Action not supported
352
+ raise exception.RSEOperationNotSupported()
353
+
348
354
  try:
349
355
  status = self.__gfal2_exist(path)
350
356
  if status:
@@ -488,12 +494,12 @@ class Default(protocol.RSEProtocol):
488
494
 
489
495
  try:
490
496
  for path in paths:
491
- if self.__gfal2_exist(path) == 0:
492
- ret = ctx.unlink(str(path))
493
- if ret:
494
- return ret
495
- else:
496
- raise exception.SourceNotFound
497
+ # GFAL does a PROPFIND request before DELETE when the scheme is
498
+ # davs://, which is wasteful.
499
+ path = re.sub('^davs://', 'https://', str(path))
500
+ ret = ctx.unlink(path)
501
+ if ret:
502
+ return ret
497
503
  return ret
498
504
  except gfal2.GError as error: # pylint: disable=no-member
499
505
  if error.code == errno.ENOENT or 'No such file' in str(error):
@@ -514,7 +520,6 @@ class Default(protocol.RSEProtocol):
514
520
  try:
515
521
  if ctx.stat(str(path)):
516
522
  return 0
517
- return -1
518
523
  except gfal2.GError as error: # pylint: disable=no-member
519
524
  if error.code == errno.ENOENT or 'No such file' in str(error): # pylint: disable=no-member
520
525
  return -1
@@ -130,7 +130,7 @@ class GlobusRSEProtocol(RSEProtocol):
130
130
 
131
131
  return ret
132
132
 
133
- def exists(self, path):
133
+ def exists(self, path: str) -> bool:
134
134
  """
135
135
  Checks if the requested file is known by the referred RSE.
136
136
 
@@ -24,7 +24,7 @@ class Default(ngarc.Default):
24
24
 
25
25
  :param props: Properties derived from the RSE Repository
26
26
  """
27
- super(Default, self).__init__(protocol_attr, rse_settings, logger=logger)
27
+ super(Default, self).__init__(protocol_attr, rse_settings, logger=logger) # type: ignore (logger might be None)
28
28
  self.attributes.pop('determinism_type', None)
29
29
  self.files = []
30
30
 
@@ -19,7 +19,7 @@ import shutil
19
19
  from subprocess import call
20
20
 
21
21
  from rucio.common import exception
22
- from rucio.common.utils import adler32
22
+ from rucio.common.checksum import adler32
23
23
  from rucio.rse.protocols import protocol
24
24
 
25
25
 
@@ -181,7 +181,7 @@ class Default(protocol.RSEProtocol):
181
181
  lfns = [lfns] if isinstance(lfns, dict) else lfns
182
182
  for lfn in lfns:
183
183
  scope, name = str(lfn['scope']), lfn['name']
184
- if lfn.get('path'):
184
+ if 'path' in lfn and lfn.get('path'):
185
185
  pfns['%s:%s' % (scope, name)] = ''.join([self.attributes['scheme'],
186
186
  '://',
187
187
  self.attributes['hostname'],