Fix unwanted error-detail inheritance bug
authorStavros Sachtouris <saxtouri@admin.grnet.gr>
Mon, 10 Dec 2012 14:14:52 +0000 (16:14 +0200)
committerStavros Sachtouris <saxtouri@admin.grnet.gr>
Mon, 10 Dec 2012 14:14:52 +0000 (16:14 +0200)
kamaki/cli/__init__.py
kamaki/clients/__init__.py

index 0772484..1daa632 100644 (file)
@@ -292,6 +292,7 @@ def _update_parser_help(parser, cmd):
 
 
 def _print_error_message(cli_err):
+    print('> > >')
     errmsg = '%s' % cli_err
     if cli_err.importance == 1:
         errmsg = magenta(errmsg)
index 450352b..a0e44cd 100644 (file)
@@ -44,7 +44,7 @@ recvlog = logging.getLogger('clients.recv')
 
 
 class ClientError(Exception):
-    def __init__(self, message, status=0, details=[]):
+    def __init__(self, message, status=0, details=None):
         try:
             message += '' if message and message[-1] == '\n' else '\n'
             serv_stat, sep, new_msg = message.partition('{')
@@ -69,7 +69,7 @@ class ClientError(Exception):
 
         super(ClientError, self).__init__(message)
         self.status = status
-        self.details = details
+        self.details = details if details else []
 
 
 class SilentEvent(Thread):