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
ea134ee5
Commit
ea134ee5
authored
Jul 22, 2014
by
Leigh B Stoller
Browse files
Return the version specific url,urn when IMAGEPROVENANCE is on.
parent
60f7d7f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
protogeni/lib/GeniCMV2.pm.in
View file @
ea134ee5
...
...
@@ -106,6 +106,7 @@ my $PRERENDER = "$TB/libexec/vis/prerender";
my
$
EMULAB_PEMFILE
=
"@prefix@/etc/genicm.pem"
;
#
Just
one
of
these
,
at
Utah
.
my
$
GENICH_PEMFILE
=
"@prefix@/etc/genich.pem"
;
my
$
WITHPROVENANCE
=
@
IMAGEPROVENANCE
@;
my
$
API_VERSION
=
2
;
#
...
...
@@ -2517,12 +2518,19 @@ sub CreateImage($)
print
STDERR
"Cannot lookup descriptor for $imagename
\n
"
;
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
);
}
if
($
WITHPROVENANCE
)
{
$
image
=
$
image
->
LookupMostRecent
();
}
#
#
Form
an
image
URN
so
the
user
knows
how
to
request
the
new
image
.
#
my
$
image_urn
=
GeniHRN
::
Generate
($
OURDOMAIN
,
"image"
,
$
pid
.
"//"
.
$
imagename
);
my
$
image_url
=
"$TBBASE/image_metadata.php?uuid="
.
$
image
->
uuid
();
my
$
version_urn
.=
":"
.
$
image
->
version
();
my
$
image_url
=
"$TBBASE/image_metadata.php?uuid="
.
$
image
->
image_uuid
();
my
$
version_url
=
"$TBBASE/image_metadata.php?uuid="
.
$
image
->
uuid
();
#
Mark
the
sliver
for
sliver
status
calls
.
We
can
also
unlock
#
since
the
state
will
prevent
anything
from
being
done
.
...
...
@@ -2549,8 +2557,11 @@ sub CreateImage($)
#
my
$
mypid
=
main
::
WrapperFork
();
if
($
mypid
)
{
return
GeniResponse
->
Create
(
GENIRESPONSE_SUCCESS
,
[$
image_urn
,
$
image_url
]);
my
@
blob
=
($
image_urn
,
$
image_url
);
if
($
WITHPROVENANCE
)
{
@
blob
=
(@
blob
,
$
version_url
,
$
version_url
);
}
return
GeniResponse
->
Create
(
GENIRESPONSE_SUCCESS
,
\@
blob
);
}
$
slice
->
UnLock
();
...
...
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