fix(velocloud): list modes errors (#2930)
This commit is contained in:
parent
fba08ac127
commit
cbbdd179cb
|
@ -51,10 +51,19 @@ sub run {
|
|||
|
||||
$self->manage_selection(%options);
|
||||
foreach my $edge (@{$self->{edges}}) {
|
||||
$self->{output}->output_add(long_msg => sprintf("[id = %s][name = %s][description = %s][edge_state = %s]" .
|
||||
"[service_state = %s][ha_state = %s][activation_state = %s]",
|
||||
$edge->{id}, $edge->{name}, $edge->{description}, $edge->{edgeState}, $edge->{serviceState},
|
||||
$edge->{haState}, $edge->{activationState}));
|
||||
$self->{output}->output_add(
|
||||
long_msg => sprintf(
|
||||
"[id = %s][name = %s][description = %s][edge_state = %s]" .
|
||||
"[service_state = %s][ha_state = %s][activation_state = %s]",
|
||||
$edge->{id},
|
||||
$edge->{name},
|
||||
defined($edge->{description}) ? $edge->{description} : '',
|
||||
$edge->{edgeState},
|
||||
$edge->{serviceState},
|
||||
$edge->{haState},
|
||||
$edge->{activationState}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$self->{output}->output_add(
|
||||
|
@ -84,7 +93,7 @@ sub disco_show {
|
|||
$self->{output}->add_disco_entry(
|
||||
id => $edge->{id},
|
||||
name => $edge->{name},
|
||||
description => $edge->{description},
|
||||
description => defined($edge->{description}) ? $edge->{description} : '',
|
||||
edge_state => $edge->{edgeState},
|
||||
service_state => $edge->{serviceState},
|
||||
ha_state => $edge->{haState},
|
||||
|
|
|
@ -40,6 +40,8 @@ sub new {
|
|||
sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::init(%options);
|
||||
|
||||
$self->{timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 900;
|
||||
}
|
||||
|
||||
sub manage_selection {
|
||||
|
@ -52,7 +54,7 @@ sub manage_selection {
|
|||
$self->{output}->output_add(long_msg => "skipping '" . $edge->{name} . "'.", debug => 1);
|
||||
next;
|
||||
}
|
||||
my $links = $options{custom}->list_links(edge_id => $edge->{id});
|
||||
my $links = $options{custom}->list_links(edge_id => $edge->{id}, timeframe => $self->{timeframe});
|
||||
foreach my $link (@{$links}) {
|
||||
push @{$self->{links}}, { %{$link}, edgeName => $edge->{name} };
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue