Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permission issue for m3db #218

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion astacus/node/clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def clear(self) -> None:
progress.start(len(self.snapshotter.snapshot))
for relative_path in self.snapshotter.snapshot.get_all_paths():
absolute_path = self.config.root / relative_path
absolute_path.unlink(missing_ok=True)
try:
absolute_path.unlink(missing_ok=True)
except PermissionError as e:
logger.error("Failed to clear: %s", absolute_path)
progress.add_success()
progress.done()
2 changes: 1 addition & 1 deletion astacus/node/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _download_snapshotfile(self, snapshotfile: ipc.SnapshotFile) -> None:

relative_path = snapshotfile.relative_path
download_path = self.dst / relative_path
download_path.parent.mkdir(parents=True, exist_ok=True)
download_path.parent.mkdir(parents=True, exist_ok=True, mode=0o770)
with utils.open_path_with_atomic_rename(download_path) as f:
if snapshotfile.hexdigest:
self.local_storage.download_hexdigest_to_file(snapshotfile.hexdigest, f)
Expand Down
2 changes: 1 addition & 1 deletion astacus/node/sqlite_snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _list_files_and_create_directories(self) -> Iterable[str]:
if any(parent.name == magic.ASTACUS_TMPDIR for parent in dir_path.parents):
continue
rel_dir = dir_path.relative_to(self._src)
(self._dst / rel_dir).mkdir(parents=True, exist_ok=True)
(self._dst / rel_dir).mkdir(parents=True, exist_ok=True, mode=0o770)
for f in files:
rel_path = str(rel_dir / f)
if not (dir_path / f).is_symlink() and self._groups.any_match(rel_path):
Expand Down
Loading