Author: rob
Date: Wed Oct 13 12:51:29 2010
New Revision: 24264
URL: https://svn.nixos.org/websvn/nix/?rev=24264&sc=1

Log:
hydra: buildmachine disabled by default, add some default constraints

Modified:
   hydra/trunk/src/lib/Hydra/Controller/Admin.pm
   hydra/trunk/src/sql/hydra.sql

Modified: hydra/trunk/src/lib/Hydra/Controller/Admin.pm
==============================================================================
--- hydra/trunk/src/lib/Hydra/Controller/Admin.pm       Wed Oct 13 12:35:34 
2010        (r24263)
+++ hydra/trunk/src/lib/Hydra/Controller/Admin.pm       Wed Oct 13 12:51:29 
2010        (r24264)
@@ -146,14 +146,15 @@
 
     requireAdmin($c);
     
-    my $hostname      = trim $c->request->params->{"hostname"};
+    my $hostname = trim $c->request->params->{"hostname"};
     error($c, "Invalid or empty hostname.") if $hostname eq "";
     
     txn_do($c->model('DB')->schema, sub {
         my $machine = $c->model('DB::BuildMachines')->create(
             { hostname => $hostname });
-        updateMachine($c, $machine);           
+        updateMachine($c, $machine);
     });
+    saveNixMachines($c);
     $c->res->redirect("/admin/machines");
 }
 

Modified: hydra/trunk/src/sql/hydra.sql
==============================================================================
--- hydra/trunk/src/sql/hydra.sql       Wed Oct 13 12:35:34 2010        (r24263)
+++ hydra/trunk/src/sql/hydra.sql       Wed Oct 13 12:51:29 2010        (r24264)
@@ -487,12 +487,12 @@
 
 create table BuildMachines (
     hostname text primary key NOT NULL,
-    username text NOT NULL,
-    ssh_key text NOT NULL,
-    options text NOT NULL,
+    username text DEFAULT '' NOT NULL,
+    ssh_key text DEFAULT '' NOT NULL,
+    options text DEFAULT '' NOT NULL,
     maxconcurrent integer DEFAULT 2 NOT NULL,
     speedfactor integer DEFAULT 1 NOT NULL,
-    enabled integer DEFAULT 1 NOT NULL
+    enabled integer DEFAULT 0 NOT NULL
 );
 
 create table BuildMachineSystemTypes (
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to