Commit 7b831721 authored by Leigh Stoller's avatar Leigh Stoller

Couple of small changes to handle image URNs that refer to a local

"generic" osid. I broke this in the previous commit wrt image handling.
parent b655b36e
......@@ -1331,7 +1331,10 @@ sub GetTicketAuxAux($)
}
goto bad;
}
if ($image->IsLocal() || $image->IsSystemImage()) {
if (!$image->isImage()) {
$osname = $image->pid() . "/" . $image->osname();
}
elsif ($image->IsLocal() || $image->IsSystemImage()) {
# No need for image_setup to look at it.
# System images are never auto imported.
$osname = $image->versname();
......
......@@ -287,9 +287,21 @@ my %localblobcache = ();
sub MapToLocalImage($$$$@)
{
my ($urn, $geniuser, $pid, $use_imagetracker, @credentials) = @_;
my $hrn = GeniHRN->new($urn);
my $hrn = GeniHRN->new($urn);
my $ospid = $hrn->ospid();
my $osname = $hrn->osname();
my ($blob, $url);
#
# Short circuit special images (generic,mfs,etc). Permission checks
# will be handled later.
#
if ($ospid eq TBOPSPID()) {
my $image = OSImage->Lookup($ospid, $osname);
return $image
if (defined($image) && !$image->isImage());
}
if ($use_imagetracker) {
if (exists($localblobcache{$urn})) {
$blob = $localblobcache{$urn};
......
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