mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-27 13:57:23 +03:00
B #1960: difference between allocate and clone/saveas
This commit is contained in:
parent
bbefdd0953
commit
34249544fd
@ -891,7 +891,8 @@ bool Image::test_set_persistent(Template * image_template, int uid, int gid,
|
||||
string per_oned;
|
||||
string conf_name;
|
||||
|
||||
bool persistent;
|
||||
bool persistent = false;
|
||||
bool tmpl_persis = false;
|
||||
|
||||
if ( is_allocate )
|
||||
{
|
||||
@ -903,10 +904,8 @@ bool Image::test_set_persistent(Template * image_template, int uid, int gid,
|
||||
}
|
||||
|
||||
int rc = nd.get_configuration_attribute(uid, gid, conf_name, per_oned);
|
||||
|
||||
bool has_persistent = image_template->get("PERSISTENT", persistent);
|
||||
|
||||
if ( rc == 0 && !has_persistent )
|
||||
|
||||
if ( rc == 0 )
|
||||
{
|
||||
if ( one_util::toupper(per_oned) == "YES" )
|
||||
{
|
||||
@ -918,6 +917,23 @@ bool Image::test_set_persistent(Template * image_template, int uid, int gid,
|
||||
}
|
||||
}
|
||||
|
||||
bool has_persistent = image_template->get("PERSISTENT", tmpl_persis);
|
||||
|
||||
if ( is_allocate )
|
||||
{
|
||||
if ( has_persistent )
|
||||
{
|
||||
persistent = tmpl_persis;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rc != 0 || ( rc == 0 && one_util::toupper(per_oned) == "" ) )
|
||||
{
|
||||
persistent = tmpl_persis;
|
||||
}
|
||||
}
|
||||
|
||||
image_template->replace("PERSISTENT", persistent);
|
||||
|
||||
return persistent;
|
||||
|
Loading…
x
Reference in New Issue
Block a user