Fix a nasty test case which was failing under 3.3.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/80d59cb8 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/80d59cb8 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/80d59cb8 Branch: refs/heads/trunk Commit: 80d59cb8bff627020054d974ecbafd049dbaa787 Parents: 069d029 Author: Tomaz Muraus <[email protected]> Authored: Thu Aug 8 15:13:34 2013 +0200 Committer: Tomaz Muraus <[email protected]> Committed: Thu Aug 8 15:13:34 2013 +0200 ---------------------------------------------------------------------- libcloud/compute/drivers/vcloud.py | 4 +--- libcloud/test/compute/test_vcloud.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/80d59cb8/libcloud/compute/drivers/vcloud.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/vcloud.py b/libcloud/compute/drivers/vcloud.py index fac74de..5687641 100644 --- a/libcloud/compute/drivers/vcloud.py +++ b/libcloud/compute/drivers/vcloud.py @@ -31,7 +31,6 @@ urlparse = urlparse.urlparse import time from xml.etree import ElementTree as ET -from xml.etree.ElementTree import _ElementInterface from xml.parsers.expat import ExpatError from libcloud.common.base import XmlResponse, ConnectionUserAndKey @@ -591,8 +590,7 @@ class VCloudNodeDriver(NodeDriver): except Exception: # The vApp was probably removed since the previous vDC query, ignore e = sys.exc_info()[1] - if not (isinstance(e.args[0], _ElementInterface) and - e.args[0].tag.endswith('Error') and + if not (e.args[0].tag.endswith('Error') and e.args[0].get('minorErrorCode') == 'ACCESS_TO_RESOURCE_IS_FORBIDDEN'): raise http://git-wip-us.apache.org/repos/asf/libcloud/blob/80d59cb8/libcloud/test/compute/test_vcloud.py ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/test_vcloud.py b/libcloud/test/compute/test_vcloud.py index b118255..b3fd6cf 100644 --- a/libcloud/test/compute/test_vcloud.py +++ b/libcloud/test/compute/test_vcloud.py @@ -415,7 +415,7 @@ class AnotherErrorMember(Exception): self.tag = 'Error' def get(self, foo): - return 'ACCESS_TO_RESOURCE_IS_FORBIDDEN' + return 'ACCESS_TO_RESOURCE_IS_FORBIDDEN_1' class AnotherError(Exception): pass
