"kinit", "-k", "-t", keytab, principal, **kwargs,
)
- async def copy(self, src, dst):
+ async def copy(self, src, dst, mode=None):
"""
Copies a file from src to dst
"""
# Copy data without any metadata
await asyncio.to_thread(shutil.copyfile, src, dst)
+ # Set mode
+ if mode:
+ await asyncio.to_thread(os.chmod, dst, mode)
+
async def make_parent_directory(self, path):
"""
Creates the parent directory of path
log.debug("Importing %s to %s..." % (self, path))
# Copy the file
- await self.backend.copy(archive.path, path)
+ await self.backend.copy(archive.path, path, mode=0o444)
# Store the path
self._set_attribute("path", path)