1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

Feature #4217: Revert "Feature #4217: Send the Market data to the driver if FROM_MARKET_ID is"

This reverts commit 9fb5c62c55.
This commit is contained in:
Jaime Melis 2016-01-26 15:26:06 +01:00
parent 29e2edc49c
commit 2b89eaaa47
2 changed files with 4 additions and 45 deletions

View File

@ -17,11 +17,11 @@
#include "ImageManager.h"
#include "NebulaLog.h"
#include "ImagePool.h"
#include "MarketPlacePool.h"
#include "SyncRequest.h"
#include "Template.h"
#include "Nebula.h"
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
@ -717,18 +717,11 @@ int ImageManager::register_image(int iid, const string& ds_data, string& error)
ostringstream oss;
Image * img;
MarketPlace * market;
string path;
string img_tmpl;
string * drv_msg;
string extra_data = "";
int market_id;
bool rc;
Nebula& nd = Nebula::instance();
MarketPlacePool * marketpool = nd.get_marketpool();
if ( imd == 0 )
{
@ -745,40 +738,7 @@ int ImageManager::register_image(int iid, const string& ds_data, string& error)
return -1;
}
// Check if FROM_MARKET_ID is defined. If it is, release image, get XML
// of the MARKET_ID and get image again.
rc = img->get_template_attribute("FROM_MARKET_ID", market_id);
if ( rc )
{
img->unlock();
// Get the market
market = marketpool->get(market_id, true);
if (market == 0)
{
oss << "Could not find market '" << market_id << "'.";
error = oss.str();
return -1;
}
market->to_xml(extra_data);
market->unlock();
// Get the image again
img = ipool->get(iid,true);
if (img == 0)
{
error = "Image deleted during copy operation";
return -1;
}
}
drv_msg = format_message(img->to_xml(img_tmpl), ds_data, extra_data);
drv_msg = format_message(img->to_xml(img_tmpl), ds_data, "");
path = img->get_path();
if ( path.empty() == true ) //NO PATH

View File

@ -189,9 +189,8 @@ module OpenNebula
tmpl << "PATH=" << self['SOURCE'] << "\n"
tmpl << "FORMAT=" << self['FORMAT'] << "\n"
tmpl << "MD5=" << self['MD5'] << "\n"
tmpl << "FROM_APP=\"" << self['ID'] << "\"\n"
tmpl << "FROM_APP_NAME=\"" << self['NAME'] << "\"\n"
tmpl << "FROM_MARKET_ID=\"" << self['MARKETPLACE_ID'] << "\"\n"
tmpl << "FROM_APP=\"" << self['ID'] << "\"\n"
tmpl << "FROM_APP_NAME=\"" << self['NAME'] << "\"\n"
image = Image.new(Image.build_xml, one)
rc = image.allocate(tmpl, options[:dsid])