Skip to content

Commit 285b0ac

Browse files
maintenance: fix-perms still prints the remote-copy hints after a failed chmod
3031bac returned 1 right after the summary, before the loop that tells the user which remote copies this command cannot reach; the exit code now comes last, so a partial sweep is reported in full before it is reported as not clean. The relocation in 3031bac's own script had aborted on a nested string; the tests passed because none asserts the hint order.
1 parent 3031bac commit 285b0ac

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎packages/agent-session-tools/src/agent_session_tools/maintenance.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ def _fix_perms(cfg: dict, dry_run: bool = False) -> int:
257257
if failed:
258258
summary += f"; {len(failed)} could not be changed"
259259
print(summary + ".")
260-
if failed:
261-
return 1
262260

263261
for name, endpoint in sorted(get_endpoints(cfg).items()):
264262
# The remote copy session-sync seeded takes the remote umask; this
@@ -271,7 +269,7 @@ def _fix_perms(cfg: dict, dry_run: bool = False) -> int:
271269
f"ssh {endpoint.get('username', '<user>')}@{ip} chmod 600 "
272270
f"{shlex.quote(remote_path)}"
273271
)
274-
return 0
272+
return 1 if failed else 0
275273

276274

277275
# A session's age is its newest known timestamp. updated_at is NULL for every

0 commit comments

Comments
 (0)