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

util: add ensure_dir_exists parameter to write_file #443

Merged
merged 1 commit into from
Jun 19, 2020

Conversation

OddBloke
Copy link
Collaborator

This allows us to disable the ensure_dir call when it isn't
appropriate.

This allows us to disable the `ensure_dir` call when it isn't
appropriate.
Copy link
Collaborator

@smoser smoser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensure_dir_exists -> mkdirs ?

2 things

  • shorter
  • plural - ensure_dir will create all parent directories on the way.

cons:

  • isn't named 'ensure_dir' which lines up with the cloud-init function.

i'm fine with either.

@OddBloke
Copy link
Collaborator Author

Thanks for taking a look! I think I prefer ensure_dir_exists; it mirrors ensure_dir (and I would have named the parameter that if it didn't shadow the function in the body of write_files) so it's consistent within the codebase, and e.g. py.path uses ensure_dir for the same concept so I think it'll be natural even for people who don't know of the existence of util.ensure_dir.

Copy link
Collaborator

@smoser smoser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good enough

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.

2 participants