Commit e4d96c5d authored by Leigh Stoller's avatar Leigh Stoller

Add a disabled bit to geni_authorities, mostly so that we can

turn off CMs at the clearinghouse, as when they are in test mode
or not usable. Note that you have to set/clear this git in the
geni-ch database on boss, for ListComponents() to be affected.
parent 9e9c658b
...@@ -37,6 +37,7 @@ CREATE TABLE `geni_authorities` ( ...@@ -37,6 +37,7 @@ CREATE TABLE `geni_authorities` (
`created` datetime default NULL, `created` datetime default NULL,
`expires` datetime default NULL, `expires` datetime default NULL,
`type` enum('sa','ma','ch','cm','ses') NOT NULL default 'sa', `type` enum('sa','ma','ch','cm','ses') NOT NULL default 'sa',
`disabled` tinyint(1) NOT NULL default '0',
`url` tinytext, `url` tinytext,
`urn` tinytext, `urn` tinytext,
PRIMARY KEY (`uuid`), PRIMARY KEY (`uuid`),
......
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# GENIPUBLIC-COPYRIGHT # GENIPUBLIC-COPYRIGHT
# Copyright (c) 2008-2009 University of Utah and the Flux Group. # Copyright (c) 2008-2010 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
package GeniAuthority; package GeniAuthority;
...@@ -187,6 +187,7 @@ sub urn($) { return field($_[0], "urn"); } ...@@ -187,6 +187,7 @@ sub urn($) { return field($_[0], "urn"); }
sub url($) { return field($_[0], "url"); } sub url($) { return field($_[0], "url"); }
sub hrn($) { return field($_[0], "hrn"); } sub hrn($) { return field($_[0], "hrn"); }
sub type($) { return field($_[0], "type"); } sub type($) { return field($_[0], "type"); }
sub disabled($) { return field($_[0], "disabled"); }
sub cert($) { return $_[0]->{'CERT'}->cert(); } sub cert($) { return $_[0]->{'CERT'}->cert(); }
sub GetCertificate($) { return $_[0]->{'CERT'}; } sub GetCertificate($) { return $_[0]->{'CERT'}; }
......
...@@ -802,6 +802,8 @@ sub ListComponents($) ...@@ -802,6 +802,8 @@ sub ListComponents($)
my $manager = GeniAuthority->Lookup($manager_uuid); my $manager = GeniAuthority->Lookup($manager_uuid);
return GeniResponse->Create(GENIRESPONSE_DBERROR) return GeniResponse->Create(GENIRESPONSE_DBERROR)
if (!defined($manager)); if (!defined($manager));
next
if ($manager->disabled());
push(@results, { "gid" => $manager->cert(), push(@results, { "gid" => $manager->cert(),
"hrn" => $manager->hrn(), "hrn" => $manager->hrn(),
......
#
# Add a disabled flag to authority, for ClearingHouse.
#
use strict;
use GeniDB;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBSetDefault($dbhandle);
if (!DBSlotExists("geni_authorities", "disabled")) {
DBQueryFatal("alter table geni_authorities ".
" add `disabled` tinyint(1) NOT NULL default '0' ".
" after `type`");
}
return 0;
}
1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment