Skip to content

Make create_directory() idempotent to support re-runs - #106

Merged
szachovy merged 3 commits into
masterfrom
fix/35-create-directory-idempotent
Apr 9, 2026
Merged

Make create_directory() idempotent to support re-runs#106
szachovy merged 3 commits into
masterfrom
fix/35-create-directory-idempotent

Conversation

@szachovy

@szachovy szachovy commented Apr 8, 2026

Copy link
Copy Markdown
Owner

Wrap sftp_client.mkdir() in try/except IOError: pass so that create_directory() silently succeeds when the directory already exists. This follows the same idempotent pattern already used by upload_directory() in the same file.

Closes #35

szachovy and others added 3 commits April 8, 2026 12:55
Wrap sftp_client.mkdir() in try/except IOError to silently handle
the case where the directory already exists. This follows the same
pattern already used by upload_directory() in the same file.

Closes #35

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace try/except IOError around sftp_client.mkdir() with
ssh_client.exec_command('mkdir -p ...') which is naturally
idempotent and consistent with the existing exec_command
pattern used by change_permissions_to_root().

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@szachovy
szachovy merged commit af601d8 into master Apr 9, 2026
12 checks passed
@szachovy
szachovy deleted the fix/35-create-directory-idempotent branch April 9, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BF-2: create_directory() is not idempotent — breaks re-runs

1 participant