From f4b04471446a8b4301e78c598f6bc1fb9774ddb3 Mon Sep 17 00:00:00 2001 From: garnier-quentin Date: Tue, 4 Feb 2020 18:00:00 +0100 Subject: [PATCH] indent enhance --- apps/pvx/restapi/mode/httphits.pm | 18 +++++++------- apps/pvx/restapi/mode/networkconnection.pm | 16 ++++++------- apps/pvx/restapi/mode/networktraffic.pm | 19 +++++++-------- .../pvx/restapi/mode/networkuserexperience.pm | 17 +++++++------ .../dell/idrac/snmp/mode/components/psu.pm | 24 ++++++++++++------- 5 files changed, 48 insertions(+), 46 deletions(-) diff --git a/apps/pvx/restapi/mode/httphits.pm b/apps/pvx/restapi/mode/httphits.pm index 5817fcb5b..0b3b1807c 100644 --- a/apps/pvx/restapi/mode/httphits.pm +++ b/apps/pvx/restapi/mode/httphits.pm @@ -73,16 +73,14 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - "instance:s" => { name => 'instance', default => 'layer' }, - "top:s" => { name => 'top' }, - "filter:s" => { name => 'filter' }, - "from:s" => { name => 'from', default => 'http' }, - "filter-counters:s" => { name => 'filter_counters' }, - }); - + + $options{options}->add_options(arguments => { + 'instance:s' => { name => 'instance', default => 'layer' }, + 'top:s' => { name => 'top' }, + 'filter:s' => { name => 'filter' }, + 'from:s' => { name => 'from', default => 'http' }, + }); + return $self; } diff --git a/apps/pvx/restapi/mode/networkconnection.pm b/apps/pvx/restapi/mode/networkconnection.pm index 81f33405e..347284370 100644 --- a/apps/pvx/restapi/mode/networkconnection.pm +++ b/apps/pvx/restapi/mode/networkconnection.pm @@ -83,15 +83,13 @@ sub new { my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - $options{options}->add_options(arguments => - { - "instance:s" => { name => 'instance', default => 'layer' }, - "top:s" => { name => 'top' }, - "filter:s" => { name => 'filter' }, - "from:s" => { name => 'from' }, - "filter-counters:s" => { name => 'filter_counters' }, - }); - + $options{options}->add_options(arguments => { + 'instance:s' => { name => 'instance', default => 'layer' }, + 'top:s' => { name => 'top' }, + 'filter:s' => { name => 'filter' }, + 'from:s' => { name => 'from' }, + }); + return $self; } diff --git a/apps/pvx/restapi/mode/networktraffic.pm b/apps/pvx/restapi/mode/networktraffic.pm index 634bfb3d0..9802f8dea 100644 --- a/apps/pvx/restapi/mode/networktraffic.pm +++ b/apps/pvx/restapi/mode/networktraffic.pm @@ -65,6 +65,7 @@ sub set_counters { } }, ]; + $self->{maps_counters}->{instances} = [ { label => 'traffic', set => { key_values => [ { name => 'traffic' }, { name => 'key' }, { name => 'instance_label' } ], @@ -116,16 +117,14 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - "instance:s" => { name => 'instance', default => 'layer' }, - "top:s" => { name => 'top' }, - "filter:s" => { name => 'filter' }, - "from:s" => { name => 'from' }, - "filter-counters:s" => { name => 'filter_counters' }, - }); - + + $options{options}->add_options(arguments => { + 'instance:s' => { name => 'instance', default => 'layer' }, + 'top:s' => { name => 'top' }, + 'filter:s' => { name => 'filter' }, + 'from:s' => { name => 'from' }, + }); + return $self; } diff --git a/apps/pvx/restapi/mode/networkuserexperience.pm b/apps/pvx/restapi/mode/networkuserexperience.pm index 8b569d90b..37ea9586d 100644 --- a/apps/pvx/restapi/mode/networkuserexperience.pm +++ b/apps/pvx/restapi/mode/networkuserexperience.pm @@ -55,15 +55,14 @@ sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; - - $options{options}->add_options(arguments => - { - "instance:s" => { name => 'instance', default => 'layer' }, - "top:s" => { name => 'top' }, - "filter:s" => { name => 'filter' }, - "from:s" => { name => 'from' }, - }); - + + $options{options}->add_options(arguments => { + 'instance:s' => { name => 'instance', default => 'layer' }, + 'top:s' => { name => 'top' }, + 'filter:s' => { name => 'filter' }, + 'from:s' => { name => 'from' }, + }); + return $self; } diff --git a/hardware/server/dell/idrac/snmp/mode/components/psu.pm b/hardware/server/dell/idrac/snmp/mode/components/psu.pm index 29ee684ac..c46e39e36 100644 --- a/hardware/server/dell/idrac/snmp/mode/components/psu.pm +++ b/hardware/server/dell/idrac/snmp/mode/components/psu.pm @@ -32,7 +32,7 @@ my $oid_powerSupplyTableEntry = '.1.3.6.1.4.1.674.10892.5.4.600.12.1'; sub load { my ($self) = @_; - + push @{$self->{request}}, { oid => $oid_powerSupplyTableEntry }; } @@ -51,17 +51,25 @@ sub check { next if ($self->check_filter(section => 'psu', instance => $instance)); $self->{components}->{psu}->{total}++; - $self->{output}->output_add(long_msg => sprintf("power supply '%s' status is '%s' [instance = %s]", - $result->{powerSupplyLocationName}, $result->{powerSupplyStatus}, $instance, - )); - + $self->{output}->output_add( + long_msg => sprintf( + "power supply '%s' status is '%s' [instance = %s]", + $result->{powerSupplyLocationName}, $result->{powerSupplyStatus}, $instance, + ) + ); my $exit = $self->get_severity(label => 'default.status', section => 'psu.status', value => $result->{powerSupplyStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { - $self->{output}->output_add(severity => $exit, - short_msg => sprintf("Power supply '%s' status is '%s'", $result->{powerSupplyLocationName}, $result->{powerSupplyStatus})); + $self->{output}->output_add( + severity => $exit, + short_msg => sprintf( + "Power supply '%s' status is '%s'", + $result->{powerSupplyLocationName}, + $result->{powerSupplyStatus} + ) + ); } } } -1; \ No newline at end of file +1;