compile: use verbose output when started from CLI
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 25 Feb 2014 10:42:32 +0000 (11:42 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 25 Feb 2014 10:42:32 +0000 (11:42 +0100)
pvefw

diff --git a/pvefw b/pvefw
index 1c346b5..30be559 100755 (executable)
--- a/pvefw
+++ b/pvefw
@@ -41,7 +41,6 @@ __PACKAGE__->register_method ({
                description => "Verbose output.",
                type => "boolean",
                optional => 1,
-               default => 0,
            },
        },
     },
@@ -50,6 +49,11 @@ __PACKAGE__->register_method ({
     code => sub {
        my ($param) = @_;
 
+       my $rpcenv = PVE::RPCEnvironment::get();
+
+       $param->{verbose} = 1 
+           if !defined($param->{verbose}) && ($rpcenv->{type} eq 'cli');
+
        my $code = sub {
            my $ruleset = PVE::Firewall::compile();
            PVE::Firewall::get_ruleset_status($ruleset, 1) if $param->{verbose};