VMM/cli/main: Check if we have warnings before exiting.
authorPascal Volk <user@localhost.localdomain.org>
Sun, 23 Sep 2012 17:22:42 +0000
changeset 616 996bfcae49b0
parent 615 5882bfdf83e8
child 617 9eecf0160c39
VMM/cli/main: Check if we have warnings before exiting. If so, print them and exit afterwards.
VirtualMailManager/cli/main.py
--- a/VirtualMailManager/cli/main.py	Sun Sep 16 17:09:45 2012 +0000
+++ b/VirtualMailManager/cli/main.py	Sun Sep 23 17:22:42 2012 +0000
@@ -62,6 +62,8 @@
         w_err(EX_USER_INTERRUPT, '', _(u'Ouch!'), '')
     except errors.VMMError, err:
         if err.code != DATABASE_ERROR:
+            if handler.has_warnings():
+                w_err(0, _(u'Warnings:'), *handler.get_warnings())
             w_err(err.code, _(u'Error: %s') % err.msg)
         w_err(err.code, unicode(err.msg, ENCODING, 'replace'))
     except (BadOptionError, ConfigValueError), err: