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/07/25 02:55:54 UTC

[5/7] incubator-trafficcontrol git commit: remove unneccesary code from safe update endpoint and improve log message

remove unneccesary code from safe update endpoint and improve log message


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

Branch: refs/heads/master
Commit: 1fe0838c20ca43f2d0a82276b509b665b4a957e3
Parents: 0763170
Author: Dylan Volz <Dy...@comcast.com>
Authored: Thu Jul 20 15:35:48 2017 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Mon Jul 24 20:55:16 2017 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Deliveryservice.pm | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/1fe0838c/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 21dc027..f7bb908 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -458,14 +458,6 @@ sub safe_update {
 
 	if ( &is_portal($self) && $helper->is_delivery_service_assigned($id) ) {
 
-		my $xml_id = $params->{xmlId};
-		if ( $ds->xml_id ne $xml_id ) {
-			my $existing = $self->db->resultset('Deliveryservice')->find( { xml_id => $xml_id } );
-			if ($existing) {
-				return $self->alert( "A deliveryservice with xmlId " . $xml_id . " already exists." );
-			}
-		}
-
 		my $values = {
 			display_name           => $params->{displayName},
 			info_url               => $params->{infoUrl},
@@ -477,12 +469,6 @@ sub safe_update {
 		my $rs = $ds->update($values);
 		if ($rs) {
 
-			# create location parameters for header_rewrite*, regex_remap* and cacheurl* config files if necessary
-			&UI::DeliveryService::header_rewrite( $self, $rs->id, $params->{profileId}, $params->{xmlId}, $params->{edgeHeaderRewrite}, "edge" );
-			&UI::DeliveryService::header_rewrite( $self, $rs->id, $params->{profileId}, $params->{xmlId}, $params->{midHeaderRewrite},  "mid" );
-			&UI::DeliveryService::regex_remap( $self, $rs->id, $params->{profileId}, $params->{xmlId}, $params->{regexRemap} );
-			&UI::DeliveryService::cacheurl( $self, $rs->id, $params->{profileId}, $params->{xmlId}, $params->{cacheurl} );
-
 			# build example urls
 			my @example_urls  = ();
 			my $cdn_domain    = $rs->cdn->domain_name;
@@ -562,7 +548,7 @@ sub safe_update {
 				}
 			);
 
-			&log( $self, "Updated deliveryservice [ '" . $rs->xml_id . "' ] with id: " . $rs->id, "APICHANGE" );
+			&log( $self, " Safe update applied to deliveryservice [ '" . $rs->xml_id . "' ] with id: " . $rs->id, "APICHANGE" );
 
 			return $self->success( \@response, "Deliveryservice safe update was successful." );
 		}