Commit 8f051d36 authored by Leigh Stoller's avatar Leigh Stoller

Better debugging to catch a failed mksyscert.

parent 6b5ea5fe
......@@ -140,7 +140,8 @@ sub Create($$$$$$)
# Create a cert pair, which gives us a new uuid.
my $certificate = GeniCertificate->Create("aggregate", $hrn, $TBOPS);
if (!defined($certificate)) {
print STDERR "Could not generate new certificate and UUID!\n";
print STDERR "GeniAggregate::Create: ".
"Could not generate new certificate and UUID for $hrn\n";
return undef;
}
my $uuid = $certificate->uuid();
......
......@@ -146,7 +146,7 @@ sub Create($$$$;$$)
push(@certlines, $_);
}
if (!close(CERT)) {
print STDERR "Could not generate a new certificate with $MKCERT\n";
print STDERR "$MKCERT failed!\n";
return undef;
}
my $cert;
......@@ -173,10 +173,16 @@ sub Create($$$$;$$)
}
if (! (defined($privkey) && defined($cert))) {
print STDERR "Could not generate a new certificate with $MKCERT\n";
foreach my $line (@certlines) {
print STDERR $line;
}
return undef;
}
if (! ($cert =~ /^[\012\015\040-\176]*$/)) {
print STDERR "Improper chars in certificate string\n";
foreach my $line (@certlines) {
print STDERR $line;
}
return undef;
}
......
......@@ -232,7 +232,8 @@ sub CreateFromLocal($$$)
#
$certificate = GeniCertificate->Create("slice", $hrn, $user->email());
if (!defined($certificate)) {
print STDERR "Could not create certificate for slice.\n";
print STDERR "GeniSlice::CreateFromLocal: ".
"Could not generate new certificate and UUID for $hrn\n";
return undef;
}
my $slice = GeniSlice->Create($certificate, $creator_uuid,
......
......@@ -176,7 +176,8 @@ sub Create($$$$$$$$;$$$)
# Create a cert pair, for this resource uuid.
$certificate = GeniCertificate->Create("sliver", $hrn, $TBOPS, $uuid);
if (!defined($certificate)) {
print STDERR "Could not generate new certificate and UUID!\n";
print STDERR "GeniSliver::Create: ".
"Could not generate new certificate and UUID for $hrn/$uuid\n";
return undef;
}
}
......
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