Skip to content
GitLab
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
0acf5db9
Commit
0acf5db9
authored
Jun 08, 2012
by
Leigh B Stoller
Browse files
Return new image urn to the user.
parent
d4a3de06
Changes
2
Hide whitespace changes
Inline
Side-by-side
protogeni/lib/GeniCMV2.pm.in
View file @
0acf5db9
...
...
@@ -2314,7 +2314,7 @@ sub CreateImage($)
my
$
opt
=
($
wholedisk
?
"-e"
:
""
);
my
$
output
=
GeniUtil
::
ExecQuiet
(
"$CLONEIMAGE $opt -s
-d
$imagename $node_id"
);
GeniUtil
::
ExecQuiet
(
"$CLONEIMAGE $opt -s $imagename $node_id"
);
#
Not
a
typical
op
,
so
always
print
debugging
info
;
print
STDERR
$
output
;
if
($?)
{
...
...
@@ -2331,6 +2331,11 @@ sub CreateImage($)
print
STDERR
"Cannot lookup descriptor for $imagename
\n
"
;
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
);
}
#
#
Form
an
image
URN
so
the
user
knows
how
to
request
the
new
image
.
#
my
$
image_urn
=
GeniHRN
::
Generate
($
OURDOMAIN
,
"image"
,
$
pid
.
"//"
.
$
imagename
);
#
#
We
used
the
-
s
(
nosnapshot
)
option
above
,
to
get
the
descriptor
...
...
@@ -2342,7 +2347,7 @@ sub CreateImage($)
if
($
mypid
)
{
#
Let
the
child
get
going
.
sleep
(
1
);
return
GeniResponse
->
Create
(
GENIRESPONSE_SUCCESS
,
undef
,
$
output
);
return
GeniResponse
->
Create
(
GENIRESPONSE_SUCCESS
,
$
image_urn
,
$
output
);
}
#
This
switches
the
file
that
we
are
writing
to
.
libaudit
::
AuditFork
();
...
...
protogeni/test/createimage.py
View file @
0acf5db9
...
...
@@ -66,5 +66,8 @@ rval,response = do_method("cm", "CreateImage", params, version="2.0")
if
rval
:
Fatal
(
"Could not create image"
)
pass
output
=
response
[
"value"
]
imageurn
=
response
[
"value"
]
output
=
response
[
"output"
]
print
str
(
imageurn
)
print
str
(
output
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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