trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dang...@apache.org
Subject [1/2] incubator-trafficcontrol git commit: fixes exampleurls on a collection and an individual ds
Date Fri, 05 May 2017 02:55:11 GMT
Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master ae81f838e -> b4ced6beb


fixes exampleurls on a collection and an individual ds


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/b71ad213
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/b71ad213
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/b71ad213

Branch: refs/heads/master
Commit: b71ad213816366281ec7715b7c8dec0fb3fe7ca9
Parents: ae81f83
Author: Jeremy Mitchell <mitchell852@gmail.com>
Authored: Thu May 4 20:45:03 2017 -0600
Committer: Dan Kirkwood <dangogh@gmail.com>
Committed: Thu May 4 20:54:38 2017 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Deliveryservice.pm | 27 +++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/b71ad213/traffic_ops/app/lib/API/Deliveryservice.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Deliveryservice.pm b/traffic_ops/app/lib/API/Deliveryservice.pm
index a6523cf..4104502 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -69,7 +69,18 @@ sub index {
 		# build example urls for each delivery service
 		my @example_urls = ();
 		my $cdn_domain   = $row->cdn->domain_name;
-		my $regexp_set   = $self->get_regexp_set( $row->deliveryservice_regexes );
+		my $ds_regexes = $row->deliveryservice_regexes;
+		my $regexp_set;
+		my $i = 0;
+
+		while ( my $ds_regex = $ds_regexes->next ) {
+			$regexp_set->[$i]->{id}         = $ds_regex->id;
+			$regexp_set->[$i]->{pattern}    = $ds_regex->regex->pattern;
+			$regexp_set->[$i]->{type}    	= $ds_regex->regex->type->name;
+			$regexp_set->[$i]->{set_number} = $ds_regex->set_number;
+			$i++;
+		}
+
 		@example_urls = &UI::DeliveryService::get_example_urls( $self, $row->id, $regexp_set,
$row, $cdn_domain, $row->protocol );
 
 		push(
@@ -171,7 +182,19 @@ sub show {
 		# build example urls for the delivery service
 		my @example_urls = ();
 		my $cdn_domain   = $row->cdn->domain_name;
-		my $regexp_set   = $self->get_regexp_set( $row->deliveryservice_regexes );
+
+		$ds_regexes->reset; # need to reset the curson
+		my $regexp_set;
+		my $i = 0;
+
+		while ( my $ds_regex = $ds_regexes->next ) {
+			$regexp_set->[$i]->{id}         = $ds_regex->id;
+			$regexp_set->[$i]->{pattern}    = $ds_regex->regex->pattern;
+			$regexp_set->[$i]->{type}    	= $ds_regex->regex->type->name;
+			$regexp_set->[$i]->{set_number} = $ds_regex->set_number;
+			$i++;
+		}
+
 		@example_urls = &UI::DeliveryService::get_example_urls( $self, $row->id, $regexp_set,
$row, $cdn_domain, $row->protocol );
 
 		push(


Mime
View raw message