Commit be5fd731 authored by Yakubov, Sergey's avatar Yakubov, Sergey
Browse files

Merge branch '2-update-rdb-protocol-for-different-download-modes' into 'main'

update rdb protocol for different download modes

Closes #2

See merge request !2
parents bbb5a8b6 14a081fe
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ image-build:
  stage: build
  variables:
    RUCIO_TAG: 1.29.8
    PROTOCOLS_VERSION: 0.2.0
    PROTOCOLS_VERSION: 0.3.0
  script:
    - >    
      docker build
+1 −1
Original line number Diff line number Diff line
[tool.poetry]
name = "rucio_protocols"
version = "0.2.0"
version = "0.3.0"
description = ""
authors = ["ORNL"]
readme = "README.md"
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ class Symlink(Default):
            self.logger(logging.ERROR, 'Symlink {} could not be created'.format(dest))
            raise exception.DestinationNotAccessible()
        ignore_broken_link = False
        if "extended_attributes" in self.attributes:
        if self.attributes.get("extended_attributes", None):
            ignore_broken_link = self.attributes["extended_attributes"].get("ignore_broken_link", False)
        if not ignore_broken_link and not os.path.exists(dest):
            # could not find the file following the symlink
+10 −1
Original line number Diff line number Diff line
@@ -40,7 +40,16 @@ class Default(protocol.RSEProtocol):
         """
        try:
            path = self.pfn2path(pfn)
            with requests.post(f"{self.attributes['scheme']}://{self.attributes['hostname']}:{self.attributes['port']}/download",
            query = ""
            if self.attributes.get("extended_attributes", None):
                as_user = self.attributes["extended_attributes"].get("as_user", False)
                remote_queue = self.attributes["extended_attributes"].get("remote_queue", None)
                if as_user:
                    query = "?asuser=true"
                if remote_queue:
                    query = "?remotequeue="+remote_queue

            with requests.post(f"{self.attributes['scheme']}://{self.attributes['hostname']}:{self.attributes['port']}/v0.1/download{query}",
                          json={"filename": path, "token": self.auth_token or ""}, stream=True) as res:
                res.raise_for_status()
                with open(dest, 'wb') as f: