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
713919ff
Commit
713919ff
authored
Aug 14, 2014
by
Leigh B Stoller
Browse files
More image version fixes.
parent
a29a2aef
Changes
4
Hide whitespace changes
Inline
Side-by-side
backend/editimageid.in
View file @
713919ff
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-201
2
University of Utah and the Flux Group.
# Copyright (c) 2000-201
4
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -152,6 +152,7 @@ my $SLOT_ADMINONLY = 0x4; # Only admins can set this field.
my
%xmlfields
=
# XML Field Name DB slot name Flags Default
("
imageid
"
=>
["
imageid
",
$SLOT_REQUIRED
],
"
version
"
=>
["
version
",
$SLOT_REQUIRED
],
# The rest are optional, so we can skip passing ones that are not changing.
"
description
"
=>
["
description
",
$SLOT_OPTIONAL
],
...
...
@@ -317,7 +318,8 @@ UserError()
# Now do special checks.
#
my
$image
=
Image
->
Lookup
(
$editimageid_args
{"
imageid
"});
my
$image
=
Image
->
Lookup
(
$editimageid_args
{"
imageid
"},
$editimageid_args
{"
version
"});
if
(
!
defined
(
$image
))
{
UserError
("
Image: No such image
");
}
...
...
utils/imagerelease.in
View file @
713919ff
...
...
@@ -40,9 +40,10 @@ sub usage()
"
-q Turn on quiet mode
\n
");
exit
(
-
1
);
}
my
$optlist
=
"
dq
";
my
$optlist
=
"
dq
f
";
my
$debug
=
0
;
my
$quiet
=
0
;
my
$force
=
0
;
#
# Configure variables
...
...
@@ -88,6 +89,9 @@ if (! getopts($optlist, \%options)) {
if
(
defined
(
$options
{"
q
"}))
{
$quiet
=
1
;
}
if
(
defined
(
$options
{"
f
"}))
{
$force
=
1
;
}
usage
()
if
(
@ARGV
!=
1
);
my
$imageid
=
$ARGV
[
0
];
...
...
@@ -112,7 +116,7 @@ if (!defined($image)) {
if
(
!
defined
(
$image
))
{
fatal
("
No such image!
");
}
if
(
$image
->
released
())
{
if
(
$image
->
released
()
&&
!
$force
)
{
fatal
("
Image is already released!
"
.
"
Maybe you need to provide imageid:version
");
}
...
...
@@ -151,7 +155,7 @@ else {
$version0
=
$image
;
}
if
(
$version0
->
path
()
=~
/^\/usr\/testbed/
)
{
$copytofile
=
"
/usr/testbed/images/
"
.
basename
(
$
version0
->
path
());
$copytofile
=
"
/usr/testbed/images/
"
.
basename
(
$
image
->
path
());
$copyfromfile
=
$image
->
path
();
if
(
$image
->
version
())
{
$updatepath
=
1
;
...
...
@@ -183,6 +187,16 @@ if (defined($copytofile)) {
fatal
("
Failed to update path
");
}
}
if
(
!
$quiet
)
{
print
"
Running imagevalidate ...
\n
";
}
system
("
$IMAGEVALIDATE
-u
"
.
(
$quiet
?
"
-q
"
:
"")
.
$image
->
pid
()
.
"
,
"
.
$image
->
imagename
()
.
"
:
"
.
$image
->
version
());
if
(
$?
)
{
$image
->
Unlock
();
fatal
("
Failed to validate the image!
");
}
}
# Now mark as released.
if
(
$image
->
Release
())
{
...
...
www/imageid_defs.php
View file @
713919ff
...
...
@@ -334,6 +334,7 @@ class Image
# Add these. Maybe caller should do this?
$args
[
"imageid"
]
=
$image
->
imageid
();
$args
[
"version"
]
=
$image
->
version
();
fwrite
(
$fp
,
"<image>
\n
"
);
foreach
(
$args
as
$name
=>
$value
)
{
...
...
www/showimageid.php3
View file @
713919ff
...
...
@@ -71,7 +71,7 @@ SUBPAGESTART();
SUBMENUSTART
(
"More Options"
);
WRITESUBMENUBUTTON
(
"Edit this Image Descriptor"
,
"editimageid.php3?imageid=
$imageid
"
);
"editimageid.php3?imageid=
$imageid
&version=
$version
"
);
if
(
$image
->
GetLogfile
())
{
WRITESUBMENUBUTTON
(
"View Log File"
,
"showimageid.php3?imageid=
$imageid
&version=
$version
&showlog=1"
);
...
...
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