From 7b255c5fb74b4047577e120d8e906521f5c656b2 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 16 Aug 2011 15:20:57 +0200 Subject: [PATCH] bug #768: POOL_FILTER is a constant instead of a configuration parameter --- src/sunstone/etc/sunstone-server.conf | 5 ----- src/sunstone/models/SunstoneServer.rb | 11 +++++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/sunstone/etc/sunstone-server.conf b/src/sunstone/etc/sunstone-server.conf index 76b5d7d24e..37ff230bdc 100644 --- a/src/sunstone/etc/sunstone-server.conf +++ b/src/sunstone/etc/sunstone-server.conf @@ -5,8 +5,3 @@ PORT=9869 # VNC Configuration VNC_PROXY_BASE_PORT=29876 NOVNC_PATH= - -# FLAG that will filter the elements retrieved from the Pools -# MINE : Connected user's resources -# GROUP : Connected user's and his group's resources -POOL_FILTER = "GROUP" \ No newline at end of file diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index 3aa6b25afc..fc553b3559 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -20,6 +20,9 @@ include OpenNebulaJSON require 'acct/watch_client' class SunstoneServer + # FLAG that will filter the elements retrieved from the Pools + POOL_FILTER = Pool::INFO_GROUP + def initialize(username, password) # TBD one_client_user(name) from CloudServer @client = Client.new("dummy:dummy") @@ -56,15 +59,11 @@ class SunstoneServer ############################################################################ # ############################################################################ - def get_pool(kind,gid,filter) + def get_pool(kind,gid) if gid == "0" user_flag = Pool::INFO_ALL else - user_flag = case filter - when "MINE" then Pool::INFO_MINE - when "GROUP" then Pool::INFO_GROUP - else Pool::INFO_GROUP - end + user_flag = POOL_FILTER end pool = case kind