|
|
dddd59 |
commit 449be745f0b7e43f54fdbab9f19873a64ca73a8f
|
|
|
dddd59 |
Author: Thomas Woerner <twoerner@redhat.com>
|
|
|
dddd59 |
Date: Fri Jul 15 19:17:48 2016 +0200
|
|
|
dddd59 |
|
|
|
dddd59 |
firewall.command: Get proper firewall error code from D-BusExceptions
|
|
|
dddd59 |
|
|
|
dddd59 |
The msg still contains the dbus exception prefix, therefore the firewall error
|
|
|
dddd59 |
code could not be looked up.
|
|
|
dddd59 |
|
|
|
dddd59 |
diff --git a/src/firewall/command.py b/src/firewall/command.py
|
|
|
dddd59 |
index a87aded..7c06ba1 100644
|
|
|
dddd59 |
--- a/src/firewall/command.py
|
|
|
dddd59 |
+++ b/src/firewall/command.py
|
|
|
dddd59 |
@@ -128,7 +128,7 @@ class FirewallCommand(object):
|
|
|
dddd59 |
message % item), code)
|
|
|
dddd59 |
_errors += 1
|
|
|
dddd59 |
except DBusException as msg:
|
|
|
dddd59 |
- code = FirewallError.get_code(str(msg))
|
|
|
dddd59 |
+ code = FirewallError.get_code(msg.get_dbus_message())
|
|
|
dddd59 |
if len(option) > 1:
|
|
|
dddd59 |
self.print_warning("Warning: %s" % msg.get_dbus_message())
|
|
|
dddd59 |
continue
|
|
|
dddd59 |
@@ -151,7 +151,7 @@ class FirewallCommand(object):
|
|
|
dddd59 |
try:
|
|
|
dddd59 |
action_method(*call_item)
|
|
|
dddd59 |
except DBusException as msg:
|
|
|
dddd59 |
- code = FirewallError.get_code(str(msg))
|
|
|
dddd59 |
+ code = FirewallError.get_code(msg.get_dbus_message())
|
|
|
dddd59 |
if len(option) > 1:
|
|
|
dddd59 |
self.print_warning("Warning: %s" % msg.get_dbus_message())
|
|
|
dddd59 |
else:
|
|
|
dddd59 |
@@ -220,7 +220,7 @@ class FirewallCommand(object):
|
|
|
dddd59 |
try:
|
|
|
dddd59 |
res = query_method(*call_item)
|
|
|
dddd59 |
except DBusException as msg:
|
|
|
dddd59 |
- code = FirewallError.get_code(str(msg))
|
|
|
dddd59 |
+ code = FirewallError.get_code(msg.get_dbus_message())
|
|
|
dddd59 |
if len(option) > 1:
|
|
|
dddd59 |
self.print_warning("Warning: %s" % msg.get_dbus_message())
|
|
|
dddd59 |
continue
|