1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

feature #4317: Set error message and code when some images cannot be

chmod'ed in a recursive operation
This commit is contained in:
Ruben S. Montero 2016-02-29 19:28:48 +01:00
parent c01dff63ec
commit 048c8991a3

View File

@ -214,6 +214,9 @@ void TemplateChmod::request_execute(xmlrpc_c::paramList const& paramList,
{
VMTemplate* tmpl = static_cast<VMTemplatePool*>(pool)->get(oid, true);
int rc = 0;
set<int> error_ids;
if ( tmpl == 0 )
{
att.resp_id = oid;
@ -238,9 +241,20 @@ void TemplateChmod::request_execute(xmlrpc_c::paramList const& paramList,
if (ec != SUCCESS)
{
NebulaLog::log("ReM", Log::ERROR, failure_message(ec, att));
}
// TODO rollback?
error_ids.insert(*it);
rc = -1;
}
}
if ( rc != 0 )
{
att.resp_msg = "Cannot chmod " + object_name(PoolObjectSQL::IMAGE) +
": " + one_util::join<set<int>::iterator>(error_ids.begin(),
error_ids.end(), ',');
failure_response(ACTION, att);
return;
}
}