From 86b37465972b27b6a71704c85e3b86c67e03fed7 Mon Sep 17 00:00:00 2001 From: Pedro Perez Date: Mon, 4 Jun 2012 18:22:30 +0200 Subject: [PATCH] openstack: extended list_servers and list_server_detail to allow all_tenants param --- lib/fog/openstack/requests/compute/list_servers.rb | 8 ++++++-- lib/fog/openstack/requests/compute/list_servers_detail.rb | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/fog/openstack/requests/compute/list_servers.rb b/lib/fog/openstack/requests/compute/list_servers.rb index a83b892f6..3fb3f2cfe 100644 --- a/lib/fog/openstack/requests/compute/list_servers.rb +++ b/lib/fog/openstack/requests/compute/list_servers.rb @@ -3,11 +3,15 @@ module Fog class OpenStack class Real - def list_servers + def list_servers(options = {}) + params = Hash.new + params['all_tenants'] = 'True' if options[:all_tenants] + request( :expects => [200, 203], :method => 'GET', - :path => 'servers.json' + :path => 'servers.json', + :query => params ) end diff --git a/lib/fog/openstack/requests/compute/list_servers_detail.rb b/lib/fog/openstack/requests/compute/list_servers_detail.rb index a6cfe3234..3010eb5fd 100644 --- a/lib/fog/openstack/requests/compute/list_servers_detail.rb +++ b/lib/fog/openstack/requests/compute/list_servers_detail.rb @@ -3,11 +3,15 @@ module Fog class OpenStack class Real - def list_servers_detail + def list_servers_detail(options = {}) + params = Hash.new + params['all_tenants'] = 'True' if options[:all_tenants] + request( :expects => [200, 203], :method => 'GET', - :path => 'servers/detail.json' + :path => 'servers/detail.json', + :query => params ) end