Commit af6a7133 authored by Leigh B Stoller's avatar Leigh B Stoller

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 5205081b 3d26e961
......@@ -463,11 +463,23 @@ sub ManagerVersion($)
sub ConvertRspec($)
{
my ($rspec) = @_;
my $template;
my $template =
if (1) {
$template =
"<rspec xmlns=\"http://protogeni.net/resources/rspec/0.2\" ".
" type=\"request\" generated_by=\"libvtop\">".
"</rspec>";
}
else {
$template =
"<rspec xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" ".
" xsi:schemaLocation=".
"\"http://www.protogeni.net/resources/rspec/0.2 ".
" http://www.protogeni.net/resources/rspec/0.2/request.xsd\" ".
" type=\"request\" generated_by=\"libvtop\"> ".
"</rspec>";
}
my $new = GeniXML::Parse($template);
if (!defined($new)) {
......@@ -1114,9 +1126,9 @@ sub Clear($$)
}
}
if (defined($sliver_credential)) {
my $method_name = "DeleteSlice";
my $method_args = undef;
if (defined($newticket)) {
my $method_name = "ReleaseTicket";
my $method_args = { "ticket" => $newticket->asString() };
if ($manager_version == 1.0) {
$method_args->{'credential'} = $slice_credential->asString();
......@@ -1130,13 +1142,13 @@ sub Clear($$)
"GeniResource::Clear Unknown version at $authority\n";
return -1;
}
print STDERR "Deleting sliver on $authority\n";
print STDERR "Deleting $newticket on $authority\n";
$response =
Genixmlrpc::CallMethod($authority->url(), $usercontext,
$method_name, $method_args);
if (!defined($response)) {
$self->{'last_rpc_error'} = GENIRESPONSE_RPCERROR();
print STDERR "*** Internal error deleting sliver for $self\n";
print STDERR "*** Internal error releasing ticket for $self\n";
return -1;
}
$self->{'last_rpc_error'} = $response->code();
......@@ -1144,28 +1156,20 @@ sub Clear($$)
$self->{'last_rpc_value'} = $response->value();
if ($response->code() != GENIRESPONSE_SUCCESS &&
$response->code() != GENIRESPONSE_SEARCHFAILED) {
print STDERR "Could not delete sliver for $self. Error: ";
print STDERR "Could not release ticket for $self. Error: ";
print STDERR " " . $response->output() . "\n";
return -1;
}
$sliver_credential->Delete();
$self->Update({"credential_idx" => 0});
#
# Delete this now; no point in waiting for the CM to tell us.
#
# Needs to move elsewhere I think.
#
my $clientsliver =
GeniRegistry::ClientSliver->LookupByAuthority($slice,
$manager_urn);
$clientsliver->Delete()
if (defined($clientsliver));
$newticket->Delete(TICKET_DELETED);
$self->Update({"newticket_idx" => 0});
}
if (defined($oldticket)) {
$oldticket->Delete(TICKET_DELETED);
$self->Update({"ticket_idx" => 0});
}
if (defined($newticket)) {
my $method_name = "ReleaseTicket";
my $method_args = { "ticket" => $newticket->asString() };
my $method_name = "DeleteSlice";
my $method_args = undef;
if ($manager_version == 1.0) {
$method_args->{'credential'} = $slice_credential->asString();
......@@ -1175,17 +1179,16 @@ sub Clear($$)
$method_args->{'slice_urn'} = $slice->urn();
}
else {
print STDERR
"GeniResource::Clear Unknown version at $authority\n";
print STDERR "GeniResource::Clear Unknown version at $authority\n";
return -1;
}
print STDERR "Deleting $newticket on $authority\n";
print STDERR "Deleting sliver on $authority\n";
$response =
Genixmlrpc::CallMethod($authority->url(), $usercontext,
$method_name, $method_args);
if (!defined($response)) {
$self->{'last_rpc_error'} = GENIRESPONSE_RPCERROR();
print STDERR "*** Internal error releasing ticket for $self\n";
print STDERR "*** Internal error deleting sliver for $self\n";
return -1;
}
$self->{'last_rpc_error'} = $response->code();
......@@ -1193,16 +1196,24 @@ sub Clear($$)
$self->{'last_rpc_value'} = $response->value();
if ($response->code() != GENIRESPONSE_SUCCESS &&
$response->code() != GENIRESPONSE_SEARCHFAILED) {
print STDERR "Could not release ticket for $self. Error: ";
print STDERR "Could not delete sliver for $self. Error: ";
print STDERR " " . $response->output() . "\n";
return -1;
}
$newticket->Delete(TICKET_DELETED);
$self->Update({"newticket_idx" => 0});
}
if (defined($oldticket)) {
$oldticket->Delete(TICKET_DELETED);
$self->Update({"ticket_idx" => 0});
#
# Delete this now; no point in waiting for the CM to tell us.
#
# Needs to move elsewhere I think.
#
my $clientsliver =
GeniRegistry::ClientSliver->LookupByAuthority($slice,
$manager_urn);
$clientsliver->Delete()
if (defined($clientsliver));
if (defined($sliver_credential)) {
$sliver_credential->Delete();
$self->Update({"credential_idx" => 0});
}
#
......
<rspec xmlns="http://protogeni.net/resources/rspec/0.1">
<node virtual_id="geni1"
colocate="geni1"
exclusive=0
exclusive="0"
virtualization_type="emulab-vnode"
virtualization_subtype="emulab-openvz">
</node>
<node virtual_id="geni2"
colocate="geni1"
exclusive=0
exclusive="0"
virtualization_type="emulab-vnode"
virtualization_subtype="emulab-openvz">
</node>
......
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