summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2016-09-05 13:15:30 +0200
committerMartin Basti <mbasti@redhat.com>2016-09-05 18:15:45 +0200
commit00d43095da211f542189c95c88fc2e2c32e75565 (patch)
treec1ed17f4b49db1562cbb55a5a9cc5cdce5dad2c3 /ipapython
parent4ae4d0d6909e99892442a170288f0eee9610d1c2 (diff)
downloadfreeipa-00d43095da211f542189c95c88fc2e2c32e75565.tar.gz
freeipa-00d43095da211f542189c95c88fc2e2c32e75565.tar.xz
freeipa-00d43095da211f542189c95c88fc2e2c32e75565.zip
Fix ScriptError to always return string from __str__
Use super for proper handling of exceptions. msg property was added due compatibility with the current code. https://fedorahosted.org/freeipa/ticket/6294 Reviewed-By: Tomas Krizek <tkrizek@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/admintool.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ipapython/admintool.py b/ipapython/admintool.py
index e40f300b1..ec0e7e079 100644
--- a/ipapython/admintool.py
+++ b/ipapython/admintool.py
@@ -38,11 +38,12 @@ class ScriptError(Exception):
def __init__(self, msg='', rval=1):
if msg is None:
msg = ''
- self.msg = msg
+ super(ScriptError, self).__init__(msg)
self.rval = rval
- def __str__(self):
- return self.msg
+ @property
+ def msg(self):
+ return str(self)
class AdminTool(object):