mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
parent
5b0d816f1a
commit
e555025cc2
@ -158,13 +158,17 @@ void PoolSQL::exist(const string& id_str, std::set<int>& id_list)
|
||||
std::vector<int> existing_items;
|
||||
|
||||
one_util::split_unique(id_str, ',', id_list);
|
||||
search(existing_items, table.c_str(), "1 order by 1 ASC");
|
||||
search(existing_items, table.c_str(), "true order by 1 ASC");
|
||||
|
||||
for (auto iterator = id_list.begin(); iterator != id_list.end(); ++iterator)
|
||||
for (auto iterator = id_list.begin(); iterator != id_list.end();)
|
||||
{
|
||||
if (!std::binary_search(existing_items.begin(), existing_items.end(), *iterator))
|
||||
{
|
||||
id_list.erase(iterator);
|
||||
iterator = id_list.erase(iterator);
|
||||
}
|
||||
else
|
||||
{
|
||||
++iterator;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,23 +49,10 @@ void VNTemplateInstantiate::request_execute(xmlrpc_c::paramList const& paramList
|
||||
string name = xmlrpc_c::value_string(paramList.getString(2));
|
||||
string str_uattrs = xmlrpc_c::value_string(paramList.getString(3));
|
||||
|
||||
if ( auto tmpl = pool->get_ro<VNTemplate>(id) )
|
||||
{
|
||||
string original_tmpl_name = tmpl->get_name();
|
||||
}
|
||||
else
|
||||
{
|
||||
att.resp_id = id;
|
||||
failure_response(NO_EXISTS, att);
|
||||
return;
|
||||
}
|
||||
|
||||
int instantiate_id = id;
|
||||
|
||||
int vid;
|
||||
ErrorCode ec;
|
||||
|
||||
ec = request_execute(instantiate_id, name, str_uattrs, 0, vid, att);
|
||||
ec = request_execute(id, name, str_uattrs, 0, vid, att);
|
||||
|
||||
if ( ec == SUCCESS )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user