Skip to content
Snippets Groups Projects
Commit 49be5af9 authored by Jim Sheckard's avatar Jim Sheckard
Browse files

WS-1137 Open permissions for delivery-generated files, for all deliveries

parent e28a999a
No related branches found
No related tags found
1 merge request!995WS-1137 Open permissions for delivery-generated files, for all deliveries
Pipeline #5947 passed
Pipeline: workspaces

#5950

    Pipeline: workspaces

    #5949

      ......@@ -67,6 +67,18 @@ class DestinationTempFile(ABC):
      """
      pass
      @abstractmethod
      def chmod(self, mode):
      """
      Modify the file's permissions during construction
      Makes use of pathlib.chmod & os.chmod, so the mode parameter
      should follow their conventions (0o777, for instance)
      :param mode: parameter passed through to libraries
      """
      pass
      class Destination(ABC):
      """
      ......
      ......@@ -64,8 +64,12 @@ class LocalDestination(Destination):
      # make the named temporary file
      rawfile = tempfile.NamedTemporaryFile(prefix=prefix_name, dir=self.path, delete=False)
      # Any of these files created during delivery will need broad permissions:
      local_file_wrapper = LocalDestinationTempFile(self, relative_path, rawfile)
      local_file_wrapper.chmod(0o777)
      # hand off to the LocalDestinationTempFile, which handles the rest
      return LocalDestinationTempFile(self, relative_path, rawfile)
      return local_file_wrapper
      def results(self) -> Dict:
      """
      ......@@ -113,3 +117,7 @@ class LocalDestinationTempFile(DestinationTempFile):
      def filename(self) -> str:
      return self.tempfile.name
      def chmod(self, mode):
      temp_path = pathlib.Path(self.filename())
      temp_path.chmod(mode)
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Finish editing this message first!
      Please register or to comment