Blob Blame History Raw
commit 80946eb1f78c7cab565742576a5d877acddb355c
Author: Jiri Popelka <jpopelka@redhat.com>
Date:   Tue Jan 14 16:19:02 2014 +0100

    firewall-cmd: show output on '--quiet --direct --passthrough'
    
    '--direct --passthrough' is special, because we don't know beforehand
    whether it will 'do' or 'show' something, i.e. whether we will
    show only status ('do something' case) or
    show only output of command and no status ('show something' case).

diff --git a/src/firewall-cmd b/src/firewall-cmd
index fc52cd0..bdb7dbe 100755
--- a/src/firewall-cmd
+++ b/src/firewall-cmd
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2009-2013 Red Hat, Inc.
+# Copyright (C) 2009-2014 Red Hat, Inc.
 #
 # Authors:
 # Thomas Woerner <twoerner@redhat.com>
@@ -958,7 +958,9 @@ elif a.direct:
     if a.passthrough:
         if len (a.passthrough) < 2:
             __fail("usage: --direct --passthrough { ipv4 | ipv6 | eb } <args>")
-        __print(fw.passthrough(_check_ipv(a.passthrough[0]), a.passthrough[1:]))
+        msg = fw.passthrough(_check_ipv(a.passthrough[0]), a.passthrough[1:])
+        if msg:
+            print(msg)
     elif a.add_chain:
         fw.addChain(_check_ipv(a.add_chain[0]), a.add_chain[1], a.add_chain[2])
     elif a.remove_chain: