fixes tests and fixes bad merge

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

Branch: refs/heads/master
Commit: da352d116183fe0b6ba8eaa630cd9928cd5b9d72
Parents: 7130816
Author: Jeremy Mitchell <[email protected]>
Authored: Thu Jun 29 10:11:33 2017 -0600
Committer: Dewayne Richardson <[email protected]>
Committed: Thu Jul 13 14:52:07 2017 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Deliveryservice.pm  | 56 ------------------------
 traffic_ops/app/t/api/1.2/deliveryservice.t |  4 +-
 traffic_ops/app/t/api/1.2/server.t          |  6 +--
 3 files changed, 4 insertions(+), 62 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/da352d11/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 0ac26f5..1587bed 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -1051,62 +1051,6 @@ sub request {
        }
 }
 
-sub assign_servers {
-       my $self      = shift;
-       my $ds_xml_Id = $self->param('xml_id');
-       my $params    = $self->req->json;
-
-       if ( !defined($params) ) {
-               return $self->alert("parameters are JSON format, please 
check!");
-       }
-       if ( !&is_oper($self) ) {
-               return $self->alert("You must be an ADMIN or OPER to perform 
this operation!");
-       }
-
-       if ( !exists( $params->{serverNames} ) ) {
-               return $self->alert("Parameter 'serverNames' is required.");
-       }
-
-       my $dsid = $self->db->resultset('Deliveryservice')->search( { xml_id => 
$ds_xml_Id } )->get_column('id')->single();
-       if ( !defined($dsid) ) {
-               return $self->alert( "DeliveryService[" . $ds_xml_Id . "] is 
not found." );
-       }
-
-       my @server_ids;
-       my $svrs = $params->{serverNames};
-       foreach my $svr (@$svrs) {
-               my $svr_id = $self->db->resultset('Server')->search( { 
host_name => $svr } )->get_column('id')->single();
-               if ( !defined($svr_id) ) {
-                       return $self->alert( "Server[" . $svr . "] is not found 
in database." );
-               }
-               push( @server_ids, $svr_id );
-       }
-
-       # clean up
-       my $delete = $self->db->resultset('DeliveryserviceServer')->search( { 
deliveryservice => $dsid } );
-       $delete->delete();
-
-       # assign servers
-       foreach my $s_id (@server_ids) {
-               my $insert = 
$self->db->resultset('DeliveryserviceServer')->create(
-                       {
-                               deliveryservice => $dsid,
-                               server          => $s_id,
-                       }
-               );
-               $insert->insert();
-       }
-
-       my $ds = $self->db->resultset('Deliveryservice')->search( { id => $dsid 
} )->single();
-       &UI::DeliveryService::header_rewrite( $self, $ds->id, $ds->profile, 
$ds->xml_id, $ds->edge_header_rewrite, "edge" );
-
-       my $response;
-       $response->{xmlId} = $ds->xml_id;
-       $response->{'serverNames'} = \@$svrs;
-
-       return $self->success($response);
-}
-
 sub is_deliveryservice_request_valid {
        my $self    = shift;
        my $details = shift;

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/da352d11/traffic_ops/app/t/api/1.2/deliveryservice.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/deliveryservice.t 
b/traffic_ops/app/t/api/1.2/deliveryservice.t
index 2c42fed..00cb167 100644
--- a/traffic_ops/app/t/api/1.2/deliveryservice.t
+++ b/traffic_ops/app/t/api/1.2/deliveryservice.t
@@ -190,9 +190,7 @@ ok 
$t->get_ok("/api/1.2/deliveryservices")->status_is(200)->or( sub { diag $t->t
        ->json_is( "/response/0/xmlId", "steering-ds1" )->json_is( 
"/response/0/logsEnabled", 0 )->json_is( "/response/0/ipv6RoutingEnabled", 1 )
        ->json_is( "/response/1/xmlId", "steering-ds2" );
 
-$t->get_ok('/api/1.2/deliveryservices?logsEnabled=true')->status_is(200)->$count_response(2)
-$t->get_ok('/api/1.2/deliveryservices/list?logsEnabled=true')->status_is(200)->$count_response(2)
-       ->or( sub { diag $t->tx->res->content->asset->{content}; } );
+$t->get_ok('/api/1.2/deliveryservices?logsEnabled=true')->status_is(200)->$count_response(2);
 
 ok $t->put_ok('/api/1.2/snapshot/cdn1')->status_is(200)->or( sub { diag 
$t->tx->res->content->asset->{content}; } );
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/da352d11/traffic_ops/app/t/api/1.2/server.t
----------------------------------------------------------------------
diff --git a/traffic_ops/app/t/api/1.2/server.t 
b/traffic_ops/app/t/api/1.2/server.t
index e034621..5591cb6 100644
--- a/traffic_ops/app/t/api/1.2/server.t
+++ b/traffic_ops/app/t/api/1.2/server.t
@@ -41,7 +41,7 @@ ok $t->post_ok( '/login', => form => { u => 
Test::TestHelper::ADMIN_USER, p => T
        ->or( sub { diag $t->tx->res->content->asset->{content}; } ), 'Should 
login?';
 
 ok $t->get_ok('/api/1.2/servers/status')->status_is(200)->or( sub { diag 
$t->tx->res->content->asset->{content}; } )
-               ->json_is( "/response/ONLINE", 14 )
+               ->json_is( "/response/ONLINE", 16 )
                ->json_is( "/response/REPORTED", 1 )
                ->or( sub { diag $t->tx->res->content->asset->{content}; } );
 
@@ -586,8 +586,8 @@ ok $t->put_ok('/api/1.2/servers/' . $server_id . '/status' 
=> {Accept => 'applic
        , 'Does the server status update succeed and updates are queued when 
the status is changed on an Edge server?';
 
 ok $t->get_ok('/api/1.2/servers/status')->status_is(200)->or( sub { diag 
$t->tx->res->content->asset->{content}; } )
-               ->json_is( "/response/ONLINE", 18 )
-               ->json_is( "/response/REPORTED", 5 )
+               ->json_is( "/response/ONLINE", 17 )
+               ->json_is( "/response/REPORTED", 1 )
                ->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}; } );

Reply via email to