Question

I'm doing fairy straightforward uploading with boto

for path, dirs, files in os.walk("data"):
    for file in files:
        k = Key(bucket)
        k.key = file
        k.set_contents_from_filename(os.path.join(path,file))

but set_contents_from_filename does not return anything. How do I tell the operation was success and not failed silently? I'm using RiakCS as a backend if it is important.

Was it helpful?

Solution

Since all of the underlying service requests that boto makes are HTTP-based, boto monitors the status codes and raises a Python exception if the HTTP status code does not indicate success. So, if it doesn't raise an exception it should be successful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top