Commit 428c9226 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add a -r option to remove any existing component/certificate and

regen.
parent 4a64493c
......@@ -14,11 +14,12 @@ use Getopt::Std;
#
sub usage()
{
print "Usage: register_resources [-f]\n";
print "Usage: register_resources [-f] [-r]\n";
exit(1);
}
my $optlist = "f";
my $optlist = "fr";
my $force = 0;
my $remove = 0;
# Configure variables
my $TB = "@prefix@";
......@@ -38,6 +39,9 @@ if (! getopts($optlist, \%options)) {
if (defined($options{"f"})) {
$force = 1;
}
if (defined($options{"r"})) {
$remove = 1;
}
use vars qw($GENI_DBNAME);
$GENI_DBNAME = "geni-cm";
......@@ -97,6 +101,10 @@ foreach my $node_id (@nodes) {
" Could not map $node_id to object\n");
}
my $component = GeniComponent->Lookup($node->uuid());
if (defined($component) && $remove) {
$component->Delete();
$component = undef;
}
if (!defined($component)) {
$certificate = GeniCertificate->Lookup($node->uuid());
if (!defined($certificate)) {
......
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