Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
e0b5257a
Commit
e0b5257a
authored
Oct 19, 2015
by
Leigh B Stoller
Browse files
Watch for an image URL that refers to the image itself instead of
an image version.
parent
88efdca5
Changes
1
Show whitespace changes
Inline
Side-by-side
protogeni/lib/GeniIMS.pm.in
View file @
e0b5257a
...
...
@@ -57,6 +57,8 @@ use Data::Dumper;
use
Date
::
Parse
;
use
POSIX
qw
(
strftime
);
use
Time
::
Local
;
use
URI
;
use
URI
::
QueryParam
;
use
Project
;
#
Configure
variables
...
...
@@ -606,6 +608,30 @@ sub GetImageInfo($)
"left join images as i on "
.
" i.image_uuid=v.image_uuid "
.
"where v.metadata_url=$safe_url"
);
if
(
defined
($
query_result
)
&&
!$query_result->numrows()) {
#
#
See
if
the
url
is
for
the
image
instead
of
a
specific
#
version
.
#
my
$
uri
=
URI
->
new
($
url
);
my
$
uuid
=
$
uri
->
query_param
(
"uuid"
);
if
($
uuid
)
{
$
query_result
=
$
DB
->
QueryWarn
(
"select i.*,v.* "
.
" from image_versions as v "
.
" inner join "
.
" (select image_uuid, "
.
" max(version) as version "
.
" from image_versions "
.
" where image_uuid='$uuid' "
.
" group by image_uuid) as ij "
.
" on v.image_uuid=ij.image_uuid and "
.
" v.version=ij.version "
.
"left join images as i on "
.
" i.image_uuid=v.image_uuid"
);
}
}
}
return
GeniResponse
->
Create
(
GENIRESPONSE_SEARCHFAILED
)
if
(
!defined($query_result) ||
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment