TT#32108 Fix "around" method parameters

Change-Id: Icb7c12c060a9d1c4a77955901c92bf250081d945
(cherry picked from commit 08724a6096)
changes/17/19717/1
Irina Peshinskaya 7 years ago
parent 0733438893
commit 07395ed1d6

@ -54,19 +54,19 @@ sub unregister_content {
}
around 'parse_rpc_response_page' => sub {
my($self, $page) = @_;
my($orig_method, $self, $page) = @_;
my $res = JSON::from_json($page);
return $res;
};
around 'parse_rpc_response' => sub {
my($self,$rpc_response) = @_;
my($orig_method, $self, $rpc_response) = @_;
return $rpc_response;
};
#Todo: unify it with snome and vendor version somehow and move to VendorRPC.pm
around 'extract_response_description' => sub {
my($self,$rpc_value) = @_;
my($orig_method, $self, $rpc_value) = @_;
my $res = '';
if(ref $rpc_value eq 'HASH'){

@ -45,7 +45,7 @@ sub unregister_content {
}
around 'process_bootstrap_uri' => sub {
my($orig_method,$self,$uri) = @_;
my($orig_method, $self, $uri) = @_;
$uri = $self->$orig_method($uri);
$uri = $self->bootstrap_uri_mac($uri);
$self->content_params->{uri} = $uri;

@ -14,6 +14,7 @@ has 'register_subscriber_content' => (
isa => Str,
accessor => '_register_subscriber_content',
);
sub rpc_server_params{
my $self = shift;
my $cfg = {
@ -27,11 +28,13 @@ sub rpc_server_params{
$self->{rpc_server_params} = $cfg;
return $self->{rpc_server_params};
}
sub register_model{
my($self) = @_;
$self->rpc_server_params;
$self->redirect_server_call('register_package');
}
sub register_package_content {
my $self = shift;
#.'_'.$self->content_params->{mac}
@ -82,15 +85,17 @@ sub unregister_content {
</request>";
return $self->{unregister_content};
}
around 'parse_rpc_response_page' => sub {
my($self, $page) = @_;
my($orig_method, $self, $page) = @_;
my $xmlDoc = XML::Mini::Document->new();
$xmlDoc->parse($page);
my $ref = $xmlDoc->toHash();
return $ref;
};
around 'parse_rpc_response' => sub {
my($self, $rpc_response) = @_;
my($orig_method, $self, $rpc_response) = @_;
my $c = $self->params->{c};
my $ret = 0;
my ($code,$message) = @{$rpc_response->{response}->{status}}{qw/ErrorCode ErrorMessage/};
@ -101,6 +106,7 @@ around 'parse_rpc_response' => sub {
$c->log->debug("NGCP::Panel::Utils::DeviceBootstrap::Polycom::parse_rpc_response: ret=$ret; code=$code; message=$message;");
return $ret;
};
1;
=head1 NAME

@ -51,7 +51,7 @@ sub unregister_content {
return $self->{unregister_content};
}
around 'extract_response_description' => sub {
my($self,$rpc_value) = @_;
my($orig_method, $self, $rpc_value) = @_;
my $c = $self->params->{c};
my $res = '';
@ -71,7 +71,7 @@ around 'extract_response_description' => sub {
};
around 'process_bootstrap_uri' => sub {
my($orig_method,$self,$uri) = @_;
my($orig_method, $self, $uri) = @_;
$uri = $self->$orig_method($uri);
$uri = $self->bootstrap_uri_mac($uri);
$self->content_params->{uri} = $uri;
@ -79,7 +79,7 @@ around 'process_bootstrap_uri' => sub {
};
around 'bootstrap_uri_mac' => sub {
my($self, $uri) = @_;
my($orig_method, $self, $uri) = @_;
if ($uri !~/\{mac\}$/){
if ($uri !~/\/$/){
$uri .= '/' ;

@ -76,7 +76,7 @@ sub register_model_content {
}
around 'process_bootstrap_uri' => sub {
my($orig_method,$self,$uri) = @_;
my($orig_method, $self, $uri) = @_;
$uri = $self->$orig_method($uri);
$self->content_params->{uri} = $uri;
$self->bootstrap_uri_server_name($uri);

Loading…
Cancel
Save