From 7e7c2451ecb9c461e830bd7711bd0ab9e0094fd8 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 24 Jun 2011 18:43:20 +0200 Subject: [PATCH] feature #696: Fixes minor bugs --- src/oca/ruby/OpenNebula/Pool.rb | 9 ++++----- src/rm/RequestManagerPoolInfoFilter.cc | 10 ++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/oca/ruby/OpenNebula/Pool.rb b/src/oca/ruby/OpenNebula/Pool.rb index 58c342e547..2608848e84 100644 --- a/src/oca/ruby/OpenNebula/Pool.rb +++ b/src/oca/ruby/OpenNebula/Pool.rb @@ -22,11 +22,6 @@ module OpenNebula include Enumerable protected - # Constants for info queries (include/RequestManagerPoolInfoFilter.h) - INFO_GROUP = -1 - INFO_ALL = -2 - INFO_MINE = -3 - #pool:: _String_ XML name of the root element #element:: _String_ XML name of the Pool elements #client:: _Client_ represents a XML-RPC connection @@ -93,6 +88,10 @@ module OpenNebula end public + # Constants for info queries (include/RequestManagerPoolInfoFilter.h) + INFO_GROUP = -1 + INFO_ALL = -2 + INFO_MINE = -3 # Iterates over every PoolElement in the Pool and calls the block with a # a PoolElement obtained calling the factory method diff --git a/src/rm/RequestManagerPoolInfoFilter.cc b/src/rm/RequestManagerPoolInfoFilter.cc index 524b2466ea..9b1ac59444 100644 --- a/src/rm/RequestManagerPoolInfoFilter.cc +++ b/src/rm/RequestManagerPoolInfoFilter.cc @@ -68,7 +68,12 @@ void RequestManagerPoolInfoFilter::request_execute(xmlrpc_c::paramList const& pa if ( start_id != -1 ) { - where_string << "AND ( oid >= " << start_id; + if (filter_flag != ALL) + { + where_string << " AND "; + } + + where_string << "( oid >= " << start_id; if ( end_id != -1 ) { @@ -84,7 +89,8 @@ void RequestManagerPoolInfoFilter::request_execute(xmlrpc_c::paramList const& pa { return; } - + + auth_object = AuthRequest::VM; // Call the template pool dump rc = pool->dump(oss,where_string.str());