You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2017/04/26 23:55:24 UTC

[5/6] incubator-trafficcontrol git commit: isdefined is not a valid check when using search. need to use count instead. updates test.

isdefined is not a valid check when using search. need to use count instead. updates test.


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

Branch: refs/heads/master
Commit: 9944b7f8266cb7b925eb4db36d4ac263ae486c05
Parents: fb7c24b
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Mon Apr 24 10:48:32 2017 -0600
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Wed Apr 26 17:54:08 2017 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/DeliveryServiceServer.pm   | 2 +-
 traffic_ops/app/t/api/1.2/deliveryservice_server.t | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9944b7f8/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 2ee1533..f2e9d88 100644
--- a/traffic_ops/app/lib/API/DeliveryServiceServer.pm
+++ b/traffic_ops/app/lib/API/DeliveryServiceServer.pm
@@ -186,7 +186,7 @@ sub remove_server_from_ds {
 	}
 
 	my $ds_server = $self->db->resultset('DeliveryserviceServer')->search( { deliveryservice => $ds_id, server => $server_id }, { prefetch => [ 'deliveryservice', 'server' ] } );
-	if ( !defined($ds_server) ) {
+	if ( $ds_server->count == 0 ) {
 		return $self->not_found();
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/9944b7f8/traffic_ops/app/t/api/1.2/deliveryservice_server.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/deliveryservice_server.t b/traffic_ops/app/t/api/1.2/deliveryservice_server.t
index ba9ad80..cf4b1c6 100644
--- a/traffic_ops/app/t/api/1.2/deliveryservice_server.t
+++ b/traffic_ops/app/t/api/1.2/deliveryservice_server.t
@@ -61,7 +61,7 @@ ok $t->get_ok('/api/1.2/deliveryserviceserver')
             , 'Does the delivery services servers details return?';
 
 ok $t->delete_ok('/api/1.2/deliveryservices/100/servers/100')->status_is(200)->or( sub { diag $t->tx->res->content->asset->{content}; } );
-ok $t->delete_ok('/api/1.2/deliveryservices/100/servers/999')->status_is(404)->or( sub { diag $t->tx->res->content->asset->{content}; } );
+ok $t->delete_ok('/api/1.2/deliveryservices/100/servers/100')->status_is(404)->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
 ok $t->get_ok('/logout')->status_is(302)->or( sub { diag $t->tx->res->content->asset->{content}; } );
 $dbh->disconnect();