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

docs: make pebble.Client.remove_path and Container.remove_path docs consistent #1031

Merged
merged 10 commits into from
Oct 10, 2023

Conversation

tonyandrewmeyer
Copy link
Contributor

  • Copy the docstring from pebble.Client.remove_path to model.Container.remove_path (and fix a missing comma).
  • Document that remove_path may raise PathError in some situations.

Annoyingly the Go docs are vague on when an error will occur. The pebble code seems to raise an error if the path is relative or if the underlying Go call does. I've kept the wording fairly generic as a result.

Fixes #699

@tonyandrewmeyer tonyandrewmeyer added the docs Improvements or additions to documentation label Oct 4, 2023
Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Couple of improvement suggestions -- feel free to tweak further.

ops/model.py Outdated Show resolved Hide resolved
ops/model.py Outdated Show resolved Hide resolved
tonyandrewmeyer and others added 3 commits October 6, 2023 17:00
Co-authored-by: Ben Hoyt <benhoyt@gmail.com>
Co-authored-by: Ben Hoyt <benhoyt@gmail.com>
ops/pebble.py Outdated
@@ -2153,11 +2153,15 @@ def remove_path(self, path: str, *, recursive: bool = False):

Args:
path: Path of the file or directory to delete from the remote system.
recursive: If True, and path is a directory recursively deletes it and
recursive: If True, and path is a directory, recursively deletes it and
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we also please copy the new version above to here? "recursive" and "Raises".

@tonyandrewmeyer
Copy link
Contributor Author

The mysql-k8s-operator tests changed, will open a separate PR for addressing that.

@benhoyt benhoyt merged commit a55a07a into canonical:main Oct 10, 2023
19 of 20 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the doc-remove_path-699 branch October 10, 2023 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document remove_path method behaviour and exceptions properly
2 participants