This is an automated email from the ASF dual-hosted git repository.

dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new f571a81  prevents parent.config failure when no delivery services 
assinged
f571a81 is described below

commit f571a817f855d24ebc89e4c7b45a3766261408c7
Author: Derek Gelinas <mrdgeli...@gmail.com>
AuthorDate: Wed Feb 21 07:19:18 2018 -0500

    prevents parent.config failure when no delivery services assinged
---
 .../app/lib/API/Configs/ApacheTrafficServer.pm     | 65 +++++++++++-----------
 1 file changed, 34 insertions(+), 31 deletions(-)

diff --git a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm 
b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
index 21a83ba..b1bd4d1 100755
--- a/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
+++ b/traffic_ops/app/lib/API/Configs/ApacheTrafficServer.pm
@@ -2465,40 +2465,43 @@ sub parent_dot_config { #fix qstring - should be ignore 
for quika
                if ( !defined($data) ) {
                        $data = $self->parent_ds_data($server_obj);
                }
-               foreach my $ds ( sort @{ $data->{dslist} } ) {
-                       my $text;
-                       my $org = $ds->{org};
-                       next if !defined $org || $org eq "";
-                       next if $done{$org};
-                       my $org_uri = URI->new($org);
-                       if ( $ds->{type} eq "HTTP_NO_CACHE" || $ds->{type} eq 
"HTTP_LIVE" || $ds->{type} eq "DNS_LIVE" ) {
-                               $text .= "dest_domain=" . $org_uri->host . " 
port=" . $org_uri->port . " go_direct=true\n";
-                       }
-                       else {
-                               # check for profile psel.qstring_handling.  If 
this parameter is assigned to the server profile,
-                               # then edges will use the qstring handling 
value specified in the parameter for all profiles.
-
-                               # If there is no defined parameter in the 
profile, then check the delivery service profile.
-                               # If psel.qstring_handling exists in the DS 
profile, then we use that value for the specified DS only.
-                               # This is used only if not overridden by a 
server profile qstring handling parameter.
-                               my $ds_qsh = $qsh;
-                               if (!defined($qsh)) {
-                                       $ds_qsh = 
$ds->{'param'}->{'parent.config'}->{'psel.qstring_handling'};
-                               }
-                               my $parent_qstring = defined($ds_qsh) ? $ds_qsh 
: "ignore";
 
-                               if ( $ds->{qstring_ignore} == 0 && 
!defined($ds_qsh) ) {
-                                       $parent_qstring = "consider";
+               if (defined($data->{dslist})) {
+                       foreach my $ds ( sort @{ $data->{dslist} } ) {
+                               my $text;
+                               my $org = $ds->{org};
+                               next if !defined $org || $org eq "";
+                               next if $done{$org};
+                               my $org_uri = URI->new($org);
+                               if ( $ds->{type} eq "HTTP_NO_CACHE" || 
$ds->{type} eq "HTTP_LIVE" || $ds->{type} eq "DNS_LIVE" ) {
+                                       $text .= "dest_domain=" . 
$org_uri->host . " port=" . $org_uri->port . " go_direct=true\n";
                                }
-                               $text
-                                       .= "dest_domain="
-                                       . $org_uri->host
-                                       . " port="
-                                       . $org_uri->port
-                                       . " $parents $secparents $round_robin 
$go_direct qstring=$parent_qstring\n";
+                               else {
+                                       # check for profile 
psel.qstring_handling.  If this parameter is assigned to the server profile,
+                                       # then edges will use the qstring 
handling value specified in the parameter for all profiles.
+       
+                                       # If there is no defined parameter in 
the profile, then check the delivery service profile.
+                                       # If psel.qstring_handling exists in 
the DS profile, then we use that value for the specified DS only.
+                                       # This is used only if not overridden 
by a server profile qstring handling parameter.
+                                       my $ds_qsh = $qsh;
+                                       if (!defined($qsh)) {
+                                               $ds_qsh = 
$ds->{'param'}->{'parent.config'}->{'psel.qstring_handling'};
+                                       }
+                                       my $parent_qstring = defined($ds_qsh) ? 
$ds_qsh : "ignore";
+       
+                                       if ( $ds->{qstring_ignore} == 0 && 
!defined($ds_qsh) ) {
+                                               $parent_qstring = "consider";
+                                       }
+                                       $text
+                                               .= "dest_domain="
+                                               . $org_uri->host
+                                               . " port="
+                                               . $org_uri->port
+                                               . " $parents $secparents 
$round_robin $go_direct qstring=$parent_qstring\n";
+                               }
+                               push @text_array, $text;
+                               $done{$org} = 1;
                        }
-                       push @text_array, $text;
-                       $done{$org} = 1;
                }
 
                my $default_dest_text;

-- 
To stop receiving notification emails like this one, please contact
dang...@apache.org.

Reply via email to