You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/01/10 03:38:40 UTC

[28/50] incubator-trafficcontrol git commit: merge psql-rebase branch

merge psql-rebase branch


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

Branch: refs/heads/master
Commit: 580c4c8d46ca344a29ea56378f9185288d9c9829
Parents: 4eaa1a7
Author: Dave Neuman <ne...@apache.org>
Authored: Fri Dec 2 15:21:59 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Sun Jan 8 21:05:00 2017 -0700

----------------------------------------------------------------------
 .../app/lib/API/DeliveryServiceServer.pm        |  3 +++
 traffic_ops/app/lib/API/Deliveryservice.pm      | 24 ++++++++++----------
 traffic_ops/app/lib/API/HwInfo.pm               |  1 +
 .../client/delivery_service_resources.go        |  2 +-
 traffic_ops/client/fixtures/delivery_service.go |  2 +-
 .../tests/integration/deliveryservice_test.go   | 15 ++++++++++++
 .../tests/integration/integration_helper.go     | 24 +++++++++++++++++++-
 7 files changed, 56 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/580c4c8d/traffic_ops/app/lib/API/DeliveryServiceServer.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/DeliveryServiceServer.pm b/traffic_ops/app/lib/API/DeliveryServiceServer.pm
index 0aec9cd..a142809 100644
--- a/traffic_ops/app/lib/API/DeliveryServiceServer.pm
+++ b/traffic_ops/app/lib/API/DeliveryServiceServer.pm
@@ -40,6 +40,9 @@ sub index {
 			}
 		);
 	}
+	#update to be ints
+	$limit += 0;
+	$page += 0;
 	$self->success( \@data, undef, $orderby, $limit, $page );
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/580c4c8d/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 6df1a50..d202691 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -303,7 +303,7 @@ sub update {
 		my @response;
 		push(
 			@response, {
-				"active"                   => \$rs->active,
+				"active"                   => $rs->active,
 				"cacheurl"                 => $rs->cacheurl,
 				"ccrDnsTtl"                => $rs->ccr_dns_ttl,
 				"cdnId"                    => $rs->cdn->id,
@@ -326,9 +326,9 @@ sub update {
 				"id"                       => $rs->id,
 				"infoUrl"                  => $rs->info_url,
 				"initialDispersion"        => $rs->initial_dispersion,
-				"ipv6RoutingEnabled"       => \$rs->ipv6_routing_enabled,
+				"ipv6RoutingEnabled"       => $rs->ipv6_routing_enabled,
 				"lastUpdated"              => $rs->last_updated,
-				"logsEnabled"              => \$rs->logs_enabled,
+				"logsEnabled"              => $rs->logs_enabled,
 				"longDesc"                 => $rs->long_desc,
 				"longDesc1"                => $rs->long_desc_1,
 				"longDesc2"                => $rs->long_desc_2,
@@ -336,7 +336,7 @@ sub update {
 				"midHeaderRewrite"         => $rs->mid_header_rewrite,
 				"missLat"                  => 0.0 + $rs->miss_lat,
 				"missLong"                 => 0.0 + $rs->miss_long,
-				"multiSiteOrigin"          => \$rs->multi_site_origin,
+				"multiSiteOrigin"          => $rs->multi_site_origin,
 				"multiSiteOriginAlgorithm" => $rs->multi_site_origin_algorithm,
 				"orgServerFqdn"            => $rs->org_server_fqdn,
 				"originShield"             => $rs->origin_shield,
@@ -347,9 +347,9 @@ sub update {
 				"qstringIgnore"            => $rs->qstring_ignore,
 				"rangeRequestHandling"     => $rs->range_request_handling,
 				"regexRemap"               => $rs->regex_remap,
-				"regionalGeoBlocking"      => \$rs->regional_geo_blocking,
+				"regionalGeoBlocking"      => $rs->regional_geo_blocking,
 				"remapText"                => $rs->remap_text,
-				"signed"                   => \$rs->signed,
+				"signed"                   => $rs->signed,
 				"sslKeyVersion"            => $rs->ssl_key_version,
 				"trRequestHeaders"         => $rs->tr_request_headers,
 				"trResponseHeaders"        => $rs->tr_response_headers,
@@ -444,7 +444,7 @@ sub create {
 		my @response;
 		push(
 			@response, {
-				"active"                   => \$rs->active,
+				"active"                   => $rs->active,
 				"cacheurl"                 => $rs->cacheurl,
 				"ccrDnsTtl"                => $rs->ccr_dns_ttl,
 				"cdnId"                    => $rs->cdn->id,
@@ -467,9 +467,9 @@ sub create {
 				"id"                       => $rs->id,
 				"infoUrl"                  => $rs->info_url,
 				"initialDispersion"        => $rs->initial_dispersion,
-				"ipv6RoutingEnabled"       => \$rs->ipv6_routing_enabled,
+				"ipv6RoutingEnabled"       => $rs->ipv6_routing_enabled,
 				"lastUpdated"              => $rs->last_updated,
-				"logsEnabled"              => \$rs->logs_enabled,
+				"logsEnabled"              => $rs->logs_enabled,
 				"longDesc"                 => $rs->long_desc,
 				"longDesc1"                => $rs->long_desc_1,
 				"longDesc2"                => $rs->long_desc_2,
@@ -477,7 +477,7 @@ sub create {
 				"midHeaderRewrite"         => $rs->mid_header_rewrite,
 				"missLat"                  => $rs->miss_lat,
 				"missLong"                 => $rs->miss_long,
-				"multiSiteOrigin"          => \$rs->multi_site_origin,
+				"multiSiteOrigin"          => $rs->multi_site_origin,
 				"multiSiteOriginAlgorithm" => $rs->multi_site_origin_algorithm,
 				"orgServerFqdn"            => $rs->org_server_fqdn,
 				"originShield"             => $rs->origin_shield,
@@ -488,9 +488,9 @@ sub create {
 				"qstringIgnore"            => $rs->qstring_ignore,
 				"rangeRequestHandling"     => $rs->range_request_handling,
 				"regexRemap"               => $rs->regex_remap,
-				"regionalGeoBlocking"      => \$rs->regional_geo_blocking,
+				"regionalGeoBlocking"      => $rs->regional_geo_blocking,
 				"remapText"                => $rs->remap_text,
-				"signed"                   => \$rs->signed,
+				"signed"                   => $rs->signed,
 				"sslKeyVersion"            => $rs->ssl_key_version,
 				"trRequestHeaders"         => $rs->tr_request_headers,
 				"trResponseHeaders"        => $rs->tr_response_headers,

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/580c4c8d/traffic_ops/app/lib/API/HwInfo.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/HwInfo.pm b/traffic_ops/app/lib/API/HwInfo.pm
index 972f76a..15ef143 100644
--- a/traffic_ops/app/lib/API/HwInfo.pm
+++ b/traffic_ops/app/lib/API/HwInfo.pm
@@ -39,6 +39,7 @@ sub index {
 			}
 		);
 	}
+
 	$limit += 0; #converts to int.
 	$self->success( \@data, undef, undef, $limit, undef );
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/580c4c8d/traffic_ops/client/delivery_service_resources.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/delivery_service_resources.go b/traffic_ops/client/delivery_service_resources.go
index 26d64d8..be6667e 100644
--- a/traffic_ops/client/delivery_service_resources.go
+++ b/traffic_ops/client/delivery_service_resources.go
@@ -190,7 +190,7 @@ type DeliveryServiceServerResponse struct {
 	Response []DeliveryServiceServer `json:"response"`
 	Size     int                     `json:"size"`
 	OrderBy  string                  `json:"orderby"`
-	Limit    int                     `json:"limit"`
+	Limit    string                  `json:"limit"`
 }
 
 // DeliveryServiceServer ...

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/580c4c8d/traffic_ops/client/fixtures/delivery_service.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/fixtures/delivery_service.go b/traffic_ops/client/fixtures/delivery_service.go
index 2408cb6..8d600b3 100644
--- a/traffic_ops/client/fixtures/delivery_service.go
+++ b/traffic_ops/client/fixtures/delivery_service.go
@@ -177,7 +177,7 @@ func DeliveryServiceServer() *client.DeliveryServiceServerResponse {
 
 	return &client.DeliveryServiceServerResponse{
 		Response: []client.DeliveryServiceServer{dss},
-		Size:     "1",
+		Size:     1,
 		OrderBy:  "foo",
 		Limit:    "1",
 	}

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/580c4c8d/traffic_ops/client/tests/integration/deliveryservice_test.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/integration/deliveryservice_test.go b/traffic_ops/client/tests/integration/deliveryservice_test.go
index 4b56058..036bb1f 100644
--- a/traffic_ops/client/tests/integration/deliveryservice_test.go
+++ b/traffic_ops/client/tests/integration/deliveryservice_test.go
@@ -1,3 +1,18 @@
+/*
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package integration
 
 import (

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/580c4c8d/traffic_ops/client/tests/integration/integration_helper.go
----------------------------------------------------------------------
diff --git a/traffic_ops/client/tests/integration/integration_helper.go b/traffic_ops/client/tests/integration/integration_helper.go
index 675934d..2468a2c 100644
--- a/traffic_ops/client/tests/integration/integration_helper.go
+++ b/traffic_ops/client/tests/integration/integration_helper.go
@@ -1,3 +1,18 @@
+/*
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+*/
+
 package integration
 
 import (
@@ -66,11 +81,18 @@ func GetType(useInTable string) (traffic_ops.Type, error) {
 }
 
 //GetDeliveryService returns a DeliveryService Struct
-func GetDeliveryService() (traffic_ops.DeliveryService, error) {
+func GetDeliveryService(cdn string) (traffic_ops.DeliveryService, error) {
 	dss, err := to.DeliveryServices()
 	if err != nil {
 		return *new(traffic_ops.DeliveryService), err
 	}
+	if cdn != "" {
+		for _, ds := range dss {
+			if ds.CDNName == cdn {
+				return ds, nil
+			}
+		}
+	}
 	return dss[0], nil
 }