From 7122f5d5b01f998522c0477289724ecc6d22e7fb Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 21 Jun 2012 16:45:52 +0200 Subject: [PATCH] Allow DATABLOCKs to be defined with PATHs --- src/image/ImageManagerActions.cc | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) 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);