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 2016/12/01 00:39:37 UTC

[1/2] incubator-trafficcontrol git commit: dnssecEnabled is required on a create and it should come across as a true/false

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/psql-rebase e8ae0a047 -> 678f49c62


dnssecEnabled is required on a create and it should come across as a true/false


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

Branch: refs/heads/psql-rebase
Commit: 875c19ec1d3dd1cb9035fdcf444edc3c36110de3
Parents: e8ae0a0
Author: Jeremy Mitchell <mi...@gmail.com>
Authored: Wed Nov 30 13:44:52 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Wed Nov 30 17:39:13 2016 -0700

----------------------------------------------------------------------
 traffic_ops/app/lib/API/Cdn.pm | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/875c19ec/traffic_ops/app/lib/API/Cdn.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/API/Cdn.pm b/traffic_ops/app/lib/API/Cdn.pm
index 14503bd..c20243e 100644
--- a/traffic_ops/app/lib/API/Cdn.pm
+++ b/traffic_ops/app/lib/API/Cdn.pm
@@ -100,18 +100,22 @@ sub create {
 		return $self->alert("CDN 'name' is required.");
 	}
 
+	if ( !defined( $params->{dnssecEnabled} ) ) {
+		return $self->alert("dnssecEnabled is required.");
+	}
+
 	my $existing = $self->db->resultset('Cdn')->search( { name => $params->{name} } )->single();
 	if ($existing) {
 		$self->app->log->error( "a cdn with name '" . $params->{name} . "' already exists." );
 		return $self->alert( "a cdn with name " . $params->{name} . " already exists." );
 	}
 
-	my $value = { name => $params->{name}, };
-	if ( defined( $params->{dnssecEnabled} ) ) {
-		$value->{dnssec_enabled} = lc( $params->{dnssecEnabled} ) ne 'false' ? 1 : 0;
-	}
+	my $values = {
+		name => $params->{name},
+		dnssec_enabled => $params->{dnssecEnabled},
+	};
 
-	my $insert = $self->db->resultset('Cdn')->create($value);
+	my $insert = $self->db->resultset('Cdn')->create($values);
 	$insert->insert();
 
 	my $rs = $self->db->resultset('Cdn')->find( { id => $insert->id } );


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

Posted by da...@apache.org.
This closes #113.


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

Branch: refs/heads/psql-rebase
Commit: 678f49c62c455e670b324d033df02cd91b627134
Parents: 875c19e
Author: Dan Kirkwood <da...@gmail.com>
Authored: Wed Nov 30 17:39:30 2016 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Wed Nov 30 17:39:30 2016 -0700

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

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