mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #1366 from CobyR/master
fix for tenant.users returning all users
This commit is contained in:
commit
aee9f10d1a
3 changed files with 17 additions and 2 deletions
|
@ -22,7 +22,7 @@ module Fog
|
|||
|
||||
def users
|
||||
requires :id
|
||||
connection.users(:tenant => self)
|
||||
connection.users(:tenant_id => self.id)
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
@ -14,8 +14,17 @@ module Fog
|
|||
|
||||
class Mock
|
||||
def list_users(tenant_id = nil)
|
||||
users = self.data[:users].values
|
||||
|
||||
if tenant_id
|
||||
users = users.select {
|
||||
|user| user['tenantId'] == tenant_id
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Excon::Response.new(
|
||||
:body => { 'users' => self.data[:users].values },
|
||||
:body => { 'users' => users },
|
||||
:status => 200
|
||||
)
|
||||
end
|
||||
|
|
|
@ -4,6 +4,12 @@ Shindo.tests("Fog::Identity[:openstack] | tenant", ['openstack']) do
|
|||
instance = Fog::Identity[:openstack].tenants.first
|
||||
instance.roles_for(0)
|
||||
end
|
||||
|
||||
tests('#users').succeeds do
|
||||
instance = Fog::Identity[:openstack].tenants.first
|
||||
|
||||
instance.users.count != Fog::Identity[:openstack].users.count
|
||||
end
|
||||
end
|
||||
|
||||
tests('CRUD') do
|
||||
|
|
Loading…
Add table
Reference in a new issue