Skip to content

Commit f7e39b5

Browse files
committed
Create attribute in RSyncer to store 'chmod' permissions value, and pass it to RSyncer from the machine config through the MultigridController
1 parent 0f0673c commit f7e39b5

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/murfey/client/multigrid_control.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ def _start_rsyncer(
378378
stop_callback=self._rsyncer_stopped,
379379
do_transfer=self.do_transfer,
380380
remove_files=remove_files,
381+
chmod=self._machine_config.get("rsync_chmod", "D0750,F0750"),
381382
substrings_blacklist=self._machine_config.get(
382383
"substrings_blacklist", {"directories": [], "files": []}
383384
),

src/murfey/client/rsync.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def __init__(
6161
local: bool = False,
6262
do_transfer: bool = True,
6363
remove_files: bool = False,
64+
chmod: str = "D0750,F0750",
6465
required_substrings_for_removal: List[str] = [],
6566
substrings_blacklist: dict[str, list[str]] = {},
6667
notify: bool = True,
@@ -75,6 +76,7 @@ def __init__(
7576
self._local = local
7677
self._do_transfer = do_transfer
7778
self._remove_files = remove_files
79+
self._chmod = chmod
7880
self._required_substrings_for_removal = required_substrings_for_removal
7981
self._substrings_blacklist = substrings_blacklist
8082
self._notify = notify
@@ -501,7 +503,7 @@ def parse_stderr(line: str):
501503
# Needed as a pair to trigger permission modifications
502504
# Ref: https://serverfault.com/a/796341
503505
"-p",
504-
"--chmod=D0750,F0750", # Use extended chmod format
506+
f"--chmod={self._chmod}", # Set permissions for transferred files and folders
505507
]
506508
# Add file locations
507509
rsync_cmd.extend([".", self._remote])

0 commit comments

Comments
 (0)