You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ne...@apache.org on 2017/04/13 19:33:43 UTC

[1/2] incubator-trafficcontrol git commit: default regex is required on a ds before dnssec keys can be created (if required)

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/master 2f165b1da -> b4cf94846


default regex is required on a ds before dnssec keys can be created (if required)


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

Branch: refs/heads/master
Commit: a98c2d24d25754c6c21feb1a5029027f9631ce77
Parents: 2f165b1
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Wed Apr 12 20:45:42 2017 -0600
Committer: David Neuman <da...@gmail.com>
Committed: Thu Apr 13 13:33:15 2017 -0600

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Deliveryservice.pm | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/a98c2d24/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 a45f816..1d41fbd 100644
--- a/traffic_ops/app/lib/API/Deliveryservice.pm
+++ b/traffic_ops/app/lib/API/Deliveryservice.pm
@@ -474,22 +474,25 @@ sub create {
 	my $insert = $self->db->resultset('Deliveryservice')->create($values)->insert();
 	if ($insert) {
 
+		&log( $self, "Created delivery service [ '" . $insert->xml_id . "' ] with id: " . $insert->id, "APICHANGE" );
+
 		# create location parameters for header_rewrite*, regex_remap* and cacheurl* config files if necessary
 		&UI::DeliveryService::header_rewrite( $self, $insert->id, $params->{profileId}, $params->{xmlId}, $params->{edgeHeaderRewrite}, "edge" );
 		&UI::DeliveryService::header_rewrite( $self, $insert->id, $params->{profileId}, $params->{xmlId}, $params->{midHeaderRewrite},  "mid" );
 		&UI::DeliveryService::regex_remap( $self, $insert->id, $params->{profileId}, $params->{xmlId}, $params->{regexRemap} );
 		&UI::DeliveryService::cacheurl( $self, $insert->id, $params->{profileId}, $params->{xmlId}, $params->{cacheurl} );
 
+		# create a default deliveryservice_regex in the format .*\.xml-id\..*
+		$self->create_default_ds_regex( $insert->id, '.*\.' . $insert->xml_id . '\..*' );
+
 		# create dnssec keys if necessary
 		my $cdn = $self->db->resultset('Cdn')->search( { id => $params->{cdnId} } )->single();
 		my $dnssec_enabled = $cdn->dnssec_enabled;
 		if ($dnssec_enabled) {
 			&UI::DeliveryService::create_dnssec_keys( $self, $cdn->name, $params->{xmlId}, $insert->id );
+			&log( $self, "Created delivery service dnssec keys for [ '" . $insert->xml_id . "' ]", "APICHANGE" );
 		}
 
-		# create a default deliveryservice_regex in the format .*\.xml-id\..*
-		$self->create_default_ds_regex( $insert->id, '.*\.' . $insert->xml_id . '\..*' );
-
 		# build example urls
 		my @example_urls  = ();
 		my $cdn_domain   = $self->get_cdn_domain_by_ds_id( $insert->id );
@@ -569,8 +572,6 @@ sub create {
 			}
 		);
 
-		&log( $self, "Created deliveryservice [ '" . $insert->xml_id . "' ] with id: " . $insert->id, "APICHANGE" );
-
 		return $self->success( \@response, "Deliveryservice creation was successful." );
 	}
 	else {
@@ -1101,7 +1102,7 @@ sub create_default_ds_regex {
 
 		# now insert the regex into the deliveryservice_regex table with set number = 0
 		$self->db->resultset('DeliveryserviceRegex')->create( { deliveryservice => $ds_id, regex => $rs_regex->id, set_number => 0 } )->insert();
-		&log( $self, "Default regex created [ " . $rs_regex->pattern . " ] for deliveryservice: " . $ds_id, "APICHANGE" );
+		&log( $self, "Created delivery service regex at position 0 [ " . $rs_regex->pattern . " ] for deliveryservice: " . $ds_id, "APICHANGE" );
 	}
 
 }


[2/2] incubator-trafficcontrol git commit: This closes #462

Posted by ne...@apache.org.
This closes #462


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

Branch: refs/heads/master
Commit: b4cf948465a8add0f72b9d6a44e177311af450f2
Parents: a98c2d2
Author: David Neuman <da...@gmail.com>
Authored: Thu Apr 13 13:33:31 2017 -0600
Committer: David Neuman <da...@gmail.com>
Committed: Thu Apr 13 13:33:31 2017 -0600

----------------------------------------------------------------------

----------------------------------------------------------------------