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
90bca5d5
Commit
90bca5d5
authored
Jun 21, 2010
by
Leigh B Stoller
Browse files
Bug fix to the type consistency checking (the checks that make sure
only one osid,pctype maps to an image (osid2imageid).
parent
d65ca782
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/newimageid.in
View file @
90bca5d5
...
...
@@ -464,12 +464,11 @@ elsif (! $isadmin) {
#
UserError
("
Node Types: Must have at least one node type
")
if
(
$#mtypes_array
<
0
);
my
$typeclause
=
join
("
or
",
map
("
type='
$_
'
",
@mtypes_array
));
# Check validity of mtype_* args, since the keys are dynamically generated.
my
$node_types_selected
=
0
;
my
@mtype_keys
=
grep
(
/^mtype_/
,
keys
(
%newimageid_args
)
);
foreach
$key
(
@
mtype_keys
)
{
my
@mtype_keys
=
(
);
foreach
$key
(
grep
(
/^
mtype_
/
,
keys
(
%newimageid_args
))
)
{
my
$value
=
$newimageid_args
{
$key
};
print
STDERR
"
mtype: '
$key
' -> '
$value
'
\n
"
if
(
$debug
);
...
...
@@ -482,11 +481,14 @@ foreach $key (@mtype_keys) {
}
elsif
(
$value
eq
"
1
")
{
$node_types_selected
++
;
push
(
@mtype_keys
,
$key
);
}
}
UserError
("
Node Types: Must select at least one node type
")
if
(
$node_types_selected
==
0
&&
!
$force
);
my
$typeclause
=
join
("
or
",
map
("
type='
$_
'
",
@mtype_keys
));
#
# Check sanity of node name and that user can create an image from it.
#
...
...
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