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

utils: T6658: fix write_file check in case of empty directory path #3989

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

jestabro
Copy link
Contributor

Change Summary

Fix check if dirname empty. This is a minor error, but an annoyance after the revisions to the migration system (T6007; not yet backported), which make use of the util write_file for vyos-save-config.py, looking ahead to making config write operations atomic (T6472).

For example, one may want to save a config locally: save some-config without dirpath, which will raise the error:
FileNotFoundError: [Errno 2] No such file or directory: ''
Fix now and backport.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

Proposed changes

How to test

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@jestabro jestabro self-assigned this Aug 15, 2024
@jestabro jestabro requested a review from a team as a code owner August 15, 2024 18:39
Copy link

github-actions bot commented Aug 15, 2024

👍
No issues in PR Title / Commit Title

@jestabro
Copy link
Contributor Author

@Mergifyio backport circinus sagitta

Copy link
Contributor

mergify bot commented Aug 15, 2024

backport circinus sagitta

✅ Backports have been created

@jestabro jestabro changed the title utils: T6658: fix check in case of empty directory path utils: T6658: fix write_file check in case of empty directory path Aug 15, 2024
@c-po c-po enabled auto-merge August 16, 2024 04:43
@c-po c-po merged commit cb1eec6 into vyos:current Aug 16, 2024
14 of 15 checks passed
c-po added a commit that referenced this pull request Aug 17, 2024
utils: T6658: fix write_file check in case of empty directory path (backport #3989)
@jestabro jestabro deleted the write_file-err branch August 21, 2024 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants