TT#28460 Fix RTC networks and RTC apps get-put use case

Set empty networks and apps to empty array.

Change-Id: I2e23de8a3fe206808766b0abf485dc6a59903c48
(cherry picked from commit 4f25a4d7de)
changes/25/19725/6
Irina Peshinskaya 8 years ago
parent 446f5ce184
commit c21f1a5948

@ -35,6 +35,10 @@ sub hal_from_item {
}); });
} else { } else {
} }
#for get=>put compatibility
if ('ARRAY' ne ref $resource->{apps}) {
$resource->{apps} = [];
}
my $hal = NGCP::Panel::Utils::DataHal->new( my $hal = NGCP::Panel::Utils::DataHal->new(
links => [ links => [

@ -38,6 +38,10 @@ sub hal_from_item {
}); });
} else { } else {
} }
#for get=>put compatibility
if ('ARRAY' ne ref $resource->{networks}) {
$resource->{networks} = [];
}
my $hal = NGCP::Panel::Utils::DataHal->new( my $hal = NGCP::Panel::Utils::DataHal->new(
links => [ links => [
@ -128,8 +132,8 @@ sub update_item {
try { try {
} catch($e) { } catch($e) {
$c->log->error("failed to update autoattendants: $e"); $c->log->error("failed to update rtcnetworks: $e");
$self->error($c, HTTP_INTERNAL_SERVER_ERROR, "Failed to update autoattendants."); $self->error($c, HTTP_INTERNAL_SERVER_ERROR, "Failed to update rtcnetworks.");
return; return;
}; };

Loading…
Cancel
Save