diff --git a/src/image/ImageManagerActions.cc b/src/image/ImageManagerActions.cc index 6ceee32f68..aafc10afe3 100644 --- a/src/image/ImageManagerActions.cc +++ b/src/image/ImageManagerActions.cc @@ -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 << "" << res << ""; } - - return 0; } add_request(&sr);