elsloo closed pull request #2288: Fix TO old Perl GUI CRConfig diff URL: https://github.com/apache/incubator-trafficcontrol/pull/2288
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/traffic_ops/app/lib/UI/Tools.pm b/traffic_ops/app/lib/UI/Tools.pm index 639c9ffe0..5af5b3cb7 100644 --- a/traffic_ops/app/lib/UI/Tools.pm +++ b/traffic_ops/app/lib/UI/Tools.pm @@ -73,7 +73,18 @@ sub diff_crconfig_iframe { my $self = shift; &stash_role($self); my $cdn_name = $self->param('cdn_name'); - my ( $json, $error ) = UI::Topology::gen_crconfig_json( $self, $cdn_name ); + + foreach my $cookie ( @{ $self->req->cookies } ) { + $self->ua->cookie_jar->add(Mojo::Cookie::Response->new(name => $cookie->{'name'}, value => $cookie->{'value'}, domain => 'localhost', path => '/')); + } + my $resp = $self->ua->request_timeout(60)->get('/api/1.2/cdns/' . $cdn_name . '/snapshot/new')->res; + my $json = undef; + my $error = undef; + if ( $resp->code ne '200' ) { + $error = $resp->message; + } else { + $json = decode_json($resp->body)->{'response'}; + } my ( @ds_text, @loc_text, @cs_text, @csds_text, @rascal_text, @ccr_text, @cfg_text ); if ( defined $error ) { diff --git a/traffic_ops/app/lib/UI/Topology.pm b/traffic_ops/app/lib/UI/Topology.pm index 987fe5bd3..2107baacd 100644 --- a/traffic_ops/app/lib/UI/Topology.pm +++ b/traffic_ops/app/lib/UI/Topology.pm @@ -848,6 +848,7 @@ sub stringify_cs_ds { foreach my $ds ( sort keys %{$csds} ) { if ( ref( $csds->{$ds} ) eq 'ARRAY' ) { foreach my $map ( @{ $csds->{$ds} } ) { + next if !defined $map; push( @strings, "|ds:" . $ds . "|server:" . $server . "|mapped:" . $map . "|" ); } } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services