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

A mechanism to only clean source snapshots if send was successful. #48

Open
doctorjames opened this issue Nov 7, 2019 · 5 comments
Open

Comments

@doctorjames
Copy link

Firstly, thank you for writing and maintaining pyznap, it's a great tool.

pyznap appears to return 0 even if there was some sort of error sending snapshots, meaning:

pysnap send && pyznap snap --clean

won't do anything useful.

I'd like to avoid getting into the situation where some failure of the transfer process inadvertently leads to all the common source snapshots being cleaned (something I experienced previously with znapzend).

Might it be possible to make pyznap continue to attempt all operations, even if one fails, but then to return an error code if any operations failed? The error code could even be a count of how many operations failed.

This would obviously make manually sending an email on failure easier too, and any other sort of automation that might wrap calling pyznap in a script.

Cheers.

@yboetz
Copy link
Owner

yboetz commented Nov 10, 2019

Good point. My reasoning was that whenever there is no crash pyznap should just return 0. Though it would make sense to return a nonzero error code if there was some error during snap/send. I'll try to implement this at some point.

@sparky8251
Copy link

Just found this wonderful tool.

Just want to say "thanks!" and toss my vote in for something like this. Would make it that much easier to use long term!

@rbrewer123
Copy link

+1 to this idea.

@cfnz
Copy link

cfnz commented Jun 25, 2020

+1 to this idea too.
I was just about to create an issue asking why it returned 0 on failure.

I have never written python, but looks like send returns the error, but _main ignores it?

@yboetz
Copy link
Owner

yboetz commented Jun 25, 2020

I was a bit inconsistent with returncodes and how they are propagated from the different functions, I'll have to clean this up at some point.

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

No branches or pull requests

5 participants