1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-03 13:47:01 +03:00

feature #523: Fixes some minor bugs for the fs drivers, and initialize source for images

This commit is contained in:
Ruben S. Montero 2011-05-07 23:30:23 +02:00
parent 76b786150a
commit f2c04245f6
3 changed files with 10 additions and 3 deletions

View File

@ -87,6 +87,7 @@ int Image::insert(SqlDB *db, string& error_str)
string public_attr;
string persistent_attr;
string dev_prefix;
string source_attr;
// ---------------------------------------------------------------------
// Check default image attributes
@ -154,10 +155,10 @@ int Image::insert(SqlDB *db, string& error_str)
// ------------ PATH & SOURCE --------------------
get_template_attribute("PATH", path_attr);
get_template_attribute("SOURCE", source);
get_template_attribute("SOURCE", source_attr);
// The template should contain PATH or SOURCE
if ( source.empty() && path_attr.empty() )
if ( source_attr.empty() && path_attr.empty() )
{
string size_attr;
string fstype_attr;
@ -183,10 +184,14 @@ int Image::insert(SqlDB *db, string& error_str)
goto error_size_format;
}
}
else if ( !source.empty() && !path_attr.empty() )
else if ( !source_attr.empty() && !path_attr.empty() )
{
goto error_path_and_source;
}
else if ( !source_attr.empty() )
{
source = source_attr;
}
state = LOCKED; //LOCKED till the ImageManager copies it to the Repository

View File

@ -30,6 +30,7 @@ else
fi
. $LIB_LOCATION/sh/scripts_common.sh
source $(dirname $0)/fsrc
# ------------ Create the image to the repository ------------

View File

@ -29,6 +29,7 @@ else
fi
. $LIB_LOCATION/sh/scripts_common.sh
source $(dirname $0)/fsrc
# ------------ Remove the image to the repository ------------