fix getmetrics resource parsing

This commit is contained in:
Colin Gagnaire 2020-07-17 16:21:36 +02:00
parent ac6acf237e
commit df69f26234
1 changed files with 17 additions and 17 deletions

View File

@ -115,15 +115,15 @@ sub check_options {
}
$self->{az_resource} = $self->{option_results}->{resource};
if ($self->{az_resource} =~ /^\/subscriptions\/.*\/resourceGroups\/.*\/providers\/Microsoft\..*\/.*\/.*$/) {
$self->{az_resource_group} = '';
$self->{az_resource_type} = '';
$self->{az_resource_namespace} = '';
} else {
$self->{az_resource_group} = $self->{option_results}->{resource_group};
$self->{az_resource_type} = $self->{option_results}->{resource_type};
$self->{az_resource_namespace} = $self->{option_results}->{resource_namespace};
if ($self->{az_resource} =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/(.*)\/(.*)\/(.*)$/) {
$self->{az_resource_group} = $1;
$self->{az_resource_namespace} = $2;
$self->{az_resource_type} = $3;
$self->{az_resource} = $4;
}
$self->{az_metrics} = [];