Commit 5c8d2e44 authored by Leigh Stoller's avatar Leigh Stoller

Bug Fix: Fix handling of disk_image in version 2 rspecs.

parent a480ef8a
......@@ -796,7 +796,7 @@ sub GetTicketAuxAux($$$$$$$$$)
#
# Check for disk_image request. Specified as a URN.
#
my $diskref = GeniXML::FindFirst("n:disk_image", $ref);
my $diskref = GeniXML::GetDiskImage($ref);
if (defined($diskref)) {
my $dname = GeniXML::GetText("name", $diskref);
......
......@@ -18,7 +18,8 @@ GetNodeId GetVirtualId GetInterfaceId GetInterfaceNodeId GetSliverId
GetManagerId GetColocate GetSubnodeOf GetStartupCommand GetTarball
GetVirtualizationType SetVirtualizationSubtype GetVirtualizationSubtype
GetExclusive SetExclusive GetLinkManager SetText GetText Serialize
CreateDocument AddElement RemoveChild PolicyExists GetMask);
CreateDocument AddElement RemoveChild PolicyExists GetMask
GetDiskImage);
use English;
use XML::LibXML;
......@@ -545,6 +546,21 @@ sub GetVirtualizationSubtype($)
return $result;
}
sub GetDiskImage($)
{
my ($node) = @_;
my $result = undef;
if (IsVersion0($node)) {
$result = FindFirst("n:disk_image", $node);
} else {
my $type = FindFirst("n:sliver_type", $node);
if (defined($type)) {
$result = FindFirst("n:disk_image", $type);
}
}
return $result;
}
sub GetExclusive($)
{
my ($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