Revert "B #1960: Follow the value of the persistent attribute in the Image template. "

This reverts commit ea760d3fe5.
This commit is contained in:
Ruben S. Montero committed 2018-04-16 16:13:01 +02:00
1 parent ea760d3fe5
commit 7e8a5ed63e
1 file changed
+11 -12
+11 -12
View File
@@ -891,19 +891,18 @@ 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 || per_oned.empty() ) //No DEFAULT_* defined or empty value
{
if ( one_util::toupper(per_oned) == "YES" )
{
persistent = true;
}
else if ( one_util::toupper(per_oned) == "NO" )
{
persistent = false;
}
image_template->get("PERSISTENT", persistent);
}
else if ( rc == 0 && one_util::toupper(per_oned) == "YES" )
{
persistent = true;
}
else
{
persistent = false;
}
image_template->replace("PERSISTENT", persistent);