graphite-project / carbonate

Utilities for managing graphite clusters
MIT License
516 stars 80 forks source link

whisper-fill dst file doesn't exists #11

Closed aruetten closed 10 years ago

aruetten commented 10 years ago

Hi,

I tried whisper-fill and it works mostly as a charm. But I have one issue with it.

It fails with a traceback if the dst file doesn’t exists.

From my point of view it's not that uncommon that at the new location not all whisper files are present after rearranging the destination.

Would it make sense for whisper-fill to simple put the src whisper file as it is at the destination if there is no file?

jssjr commented 10 years ago

Yes, that is the expected behavior. This must have broken at some point and wasn't caught by the tests.

jssjr commented 10 years ago

After reading your comment a second time, I may have misunderstood. The carbon-sync tool will copy the source file if the destination file isn't present, but whisper-fill expects a valid source and destination argument. Regardless, a traceback is an ugly user experience that needs to be caught and handled better.

jssjr commented 10 years ago

@aruetten I'm updating the script to exit with an error message and exit 1 if either the source or destination arguments to whisper-fill are not files. This should be easier to follow. To add the behavior you want, I suggest something like this:

whisper-fill SRC DST || cp SRC DST
aruetten commented 10 years ago

@jssjr

I'll try that. Thanks for your really quick response!