hydra: buildmachine disabled by default, add some default constraints

This commit is contained in:
Rob Vermaas 2010-10-13 12:51:29 +00:00
parent ef1efa80e4
commit a391c78aaf
2 changed files with 7 additions and 6 deletions

View file

@ -146,14 +146,15 @@ sub create_machine_submit : Chained('admin') PathPart('create-machine/submit') A
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");
}

View file

@ -487,12 +487,12 @@ create table NewsItems (
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 (