You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the filesystem doesn't have the: /opt/xensource/sm/XE_SR_ERRORCODES.xml
file, it fails in a very ugly way:
on xs64bit:
======================================================================
ERROR: test_mount (test_NFSSR.TestNFSSR)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage-manager/sm/tests/testlib.py", line 279, in decorated
result = func(self, context, *args, **kwargs)
File "/storage-manager/sm/tests/test_NFSSR.py", line 34, in test_mount
sr = create_nfs_sr()
File "/storage-manager/sm/tests/test_NFSSR.py", line 27, in create_nfs_sr
sr = NFSSR.NFSSR(command, '0')
File "/storage-manager/sm/drivers/SR.py", line 139, in __init__
self.load(sr_uuid)
File "/storage-manager/sm/drivers/NFSSR.py", line 75, in load
raise xs_errors.XenError('ConfigServerMissing')
File "/storage-manager/sm/drivers/xs_errors.py", line 32, in __init__
raise Exception.__init__(self, '')
TypeError: TypeError: unbound method __init__() must be called with Exception instance as first argument (got XenError instance instead)
on trunk:
======================================================================
ERROR: test_mount (test_NFSSR.TestNFSSR)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage-manager/sm/tests/testlib.py", line 279, in decorated
result = func(self, context, *args, **kwargs)
File "/storage-manager/sm/tests/test_NFSSR.py", line 34, in test_mount
sr = create_nfs_sr()
File "/storage-manager/sm/tests/test_NFSSR.py", line 27, in create_nfs_sr
sr = NFSSR.NFSSR(command, '0')
File "/storage-manager/sm/drivers/SR.py", line 139, in __init__
self.load(sr_uuid)
File "/storage-manager/sm/drivers/NFSSR.py", line 75, in load
raise xs_errors.XenError('ConfigServerMissing')
File "/storage-manager/sm/drivers/xs_errors.py", line 32, in __init__
raise Exception.__init__(self, '')
TypeError: TypeError: exceptions must be classes, instances, or strings (deprecated), not NoneType
So we should come up with a different fix, something like:
--- a/drivers/xs_errors.py+++ b/drivers/xs_errors.py@@ -28,8 +28,7 @@ class XenError(object):
def __init__(self, key, opterr=None):
# Check the XML definition file exists
if not os.path.exists(XML_DEFS):
- print "No XML def file found"- raise Exception.__init__(self, '')+ raise Exception("No XML def file found")
# Read the definition list
self._fromxml('SM-errorcodes')
In this case you get the output:
======================================================================
ERROR: test_mount (test_NFSSR.TestNFSSR)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/storage-manager/sm/tests/testlib.py", line 279, in decorated
result = func(self, context, *args, **kwargs)
File "/storage-manager/sm/tests/test_NFSSR.py", line 34, in test_mount
sr = create_nfs_sr()
File "/storage-manager/sm/tests/test_NFSSR.py", line 27, in create_nfs_sr
sr = NFSSR.NFSSR(command, '0')
File "/storage-manager/sm/drivers/SR.py", line 139, in __init__
self.load(sr_uuid)
File "/storage-manager/sm/drivers/NFSSR.py", line 75, in load
raise xs_errors.XenError('ConfigServerMissing')
File "/storage-manager/sm/drivers/xs_errors.py", line 31, in __init__
raise Exception("No XML def file found")
Exception: No XML def file found
Which now makes sense
The text was updated successfully, but these errors were encountered:
If the XML error description does not exist in the filesystem, XenError
tried to call Exception.__init__(self, ''), which is invalid, as self is
not inheriting from Exception.
Github: fixes#158
Signed-off-by: Mate Lakat <mate.lakat@citrix.com>
If the XML error description does not exist in the filesystem, XenError
tried to call Exception.__init__(self, ''), which is invalid, as self is
not inheriting from Exception.
Github: fixesxapi-project#158
(cherry picked from commit cb1e0df)
If the filesystem doesn't have the:
/opt/xensource/sm/XE_SR_ERRORCODES.xml
file, it fails in a very ugly way:
on xs64bit:
on trunk:
So we should come up with a different fix, something like:
In this case you get the output:
Which now makes sense
The text was updated successfully, but these errors were encountered: