Commit 7c5abedc authored by Russ Fish's avatar Russ Fish

Don't check osid/imageid mapping if no partition OS's specified.

parent 0654df90
......@@ -368,18 +368,18 @@ for (my $i = 1; $i <= 4; $i++) {
$osidclause .= "osid='$foo'";
}
}
DBQueryFatal("lock tables images write, os_info write, osidtoimageid write");
my $imageid = $image->imageid();
my $query_result =
if (defined($osidclause)) {
DBQueryFatal("lock tables images write, os_info write, osidtoimageid write");
my $imageid = $image->imageid();
my $query_result =
DBQueryFatal("select osidtoimageid.*,images.pid,images.imagename ".
" from osidtoimageid ".
"left join images on ".
" images.imageid=osidtoimageid.imageid ".
"where ($osidclause) and ($typeclause) and ".
" images.imageid!='$imageid'");
DBQueryFatal("unlock tables");
if ($query_result->numrows) {
DBQueryFatal("unlock tables");
if ($query_result->numrows) {
my $msg =
"There are other image descriptors that specify the same OS".
......@@ -397,6 +397,7 @@ if ($query_result->numrows) {
UserError("Conflict: Please check the other Image descriptors".
" and make the necessary changes!\n $msg");
}
}
exit(0)
......
......@@ -423,18 +423,18 @@ for ($i = 1; $i <= 4; $i++) {
$osid_array[] = $defaults[$foo];
}
}
DBQueryFatal("lock tables images write, os_info write, osidtoimageid write");
$query_result =
if (isset($osidclause)) {
DBQueryFatal("lock tables images write, os_info write, osidtoimageid write");
$query_result =
DBQueryFatal("select osidtoimageid.*,images.pid,images.imagename ".
" from osidtoimageid ".
"left join images on ".
" images.imageid=osidtoimageid.imageid ".
"where ($osidclause) and ($typeclause) and ".
" images.imageid!='$imageid'");
DBQueryFatal("unlock tables");
DBQueryFatal("unlock tables");
if (mysql_num_rows($query_result)) {
if (mysql_num_rows($query_result)) {
echo "<center>
There are other image descriptors that specify the
same OS descriptors for the same node types.<br>
......@@ -470,6 +470,7 @@ if (mysql_num_rows($query_result)) {
USERERROR("Please check the other Image descriptors and make the ".
"necessary changes!", 1);
}
}
# Send to the backend for more checking, and eventually, to update the DB.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment