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

Allow DATABLOCKs to be defined with PATHs

This commit is contained in:
Ruben S. Montero 2012-06-21 16:45:52 +02:00
parent 4eb509722f
commit 7122f5d5b0

View File

@ -641,15 +641,24 @@ int ImageManager::stat_image(Template* img_tmpl,
break;
case Image::DATABLOCK:
img_tmpl->get("SIZE", res);
img_tmpl->get("PATH", res);
if (res.empty())
if (res.empty())//no PATH
{
res = "SIZE attribute is mandatory for DATABLOCK.";
return -1;
img_tmpl->get("SIZE", res);
if (res.empty())
{
res = "SIZE or PATH attributes are mandatory for DATABLOCK.";
return -1;
}
return 0;
}
else
{
img_data << "<IMAGE><PATH>" << res << "</PATH></IMAGE>";
}
return 0;
}
add_request(&sr);