mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 11:22:55 +09:00
B #1960: Follow the value of the persistent attribute in the Image template.
This commit is contained in:
1 parent
87cc3396ef
commit
ea760d3fe5
1 file changed
+12
-11
+12
-11
@@ -891,18 +891,19 @@ bool Image::test_set_persistent(Template * image_template, int uid, int gid,
|
||||
}
|
||||
|
||||
int rc = nd.get_configuration_attribute(uid, gid, conf_name, per_oned);
|
||||
|
||||
if ( rc != 0 || per_oned.empty() ) //No DEFAULT_* defined or empty value
|
||||
|
||||
bool has_persistent = image_template->get("PERSISTENT", persistent);
|
||||
|
||||
if ( rc == 0 && !has_persistent )
|
||||
{
|
||||
image_template->get("PERSISTENT", persistent);
|
||||
}
|
||||
else if ( rc == 0 && one_util::toupper(per_oned) == "YES" )
|
||||
{
|
||||
persistent = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
persistent = false;
|
||||
if ( one_util::toupper(per_oned) == "YES" )
|
||||
{
|
||||
persistent = true;
|
||||
}
|
||||
else if ( one_util::toupper(per_oned) == "NO" )
|
||||
{
|
||||
persistent = false;
|
||||
}
|
||||
}
|
||||
|
||||
image_template->replace("PERSISTENT", persistent);
|
||||
|
||||
Reference in new issue
Block a user