You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2017/04/24 02:20:32 UTC

[3/6] libcloud git commit: better fault handling for s3 import

better fault handling for s3 import


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/13df973f
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/13df973f
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/13df973f

Branch: refs/heads/trunk
Commit: 13df973f2c92f60d0295b0a15437fef891034473
Parents: 4229ddf
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Apr 24 11:13:56 2017 +1000
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Apr 24 11:13:56 2017 +1000

----------------------------------------------------------------------
 libcloud/storage/drivers/s3.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/13df973f/libcloud/storage/drivers/s3.py
----------------------------------------------------------------------
diff --git a/libcloud/storage/drivers/s3.py b/libcloud/storage/drivers/s3.py
index 63c3046..0af858a 100644
--- a/libcloud/storage/drivers/s3.py
+++ b/libcloud/storage/drivers/s3.py
@@ -20,10 +20,13 @@ import time
 from hashlib import sha1
 
 import libcloud.utils.py3
-if libcloud.utils.py3.DEFAULT_LXML:
-    from lxml.etree import Element, SubElement
-else:
-    from xml.etree.ElementTree import Element, SubElement
+try:
+    if DEFAULT_LXML:
+        from lxml.etree import Element, SubElement
+    else:
+        from xml.etree import Element, SubElement
+except ImportError:
+    from xml.etree import Element, SubElement
 
 from libcloud.utils.py3 import httplib
 from libcloud.utils.py3 import urlquote