Author: tomaz
Date: Sat Apr 9 16:07:04 2011
New Revision: 1090619
URL: http://svn.apache.org/viewvc?rev=1090619&view=rev
Log:
If a provided file_path does not exist, throw an exception early.
Modified:
incubator/libcloud/trunk/libcloud/storage/base.py
Modified: incubator/libcloud/trunk/libcloud/storage/base.py
URL:
http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/storage/base.py?rev=1090619&r1=1090618&r2=1090619&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/storage/base.py (original)
+++ incubator/libcloud/trunk/libcloud/storage/base.py Sat Apr 9 16:07:04 2011
@@ -489,6 +489,10 @@ class StorageDriver(object):
passed in callback which uploads an object.
"""
headers = headers or {}
+
+ if file_path and not os.path.exists(file_path):
+ raise OSError('File %s does not exist' % (file_path))
+
if not content_type:
if file_path:
name = file_path