1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #3265 from mikehale/fix-1322

Fix 1322
This commit is contained in:
Wesley Beary 2014-11-13 15:28:23 -06:00
commit 446407b127
5 changed files with 12 additions and 8 deletions

View file

@ -17,7 +17,7 @@ module Fog
requires :rolename
requires :assume_role_policy_document
data = service.create_role(rolename, assume_role_policy_document).body["Role"]
data = service.create_role(rolename, assume_role_policy_document, path).body["Role"]
merge_attributes(data)
true
end

View file

@ -20,7 +20,7 @@ module Fog
role = nil
begin
role = service.roles.new( service.get_role( identity ).data[:body]["Role"] )
rescue Excon::Errors::NotFound # ignore not found error
rescue Excon::Errors::NotFound, Fog::AWS::IAM::NotFound # ignore not found error
end
role
end

View file

@ -1,6 +1,5 @@
Shindo.tests("Fog::Compute[:iam] | access_keys", ['aws','iam']) do
Fog.mock!
iam = Fog::AWS[:iam]
@username = 'fake_user'
@ -48,6 +47,7 @@ Shindo.tests("Fog::Compute[:iam] | access_keys", ['aws','iam']) do
end
# clean up
@user.access_keys.map(&:destroy)
@user.destroy
end

View file

@ -1,6 +1,5 @@
Shindo.tests("Fog::Compute[:iam] | policies", ['aws','iam']) do
Fog.mock!
iam = Fog::AWS[:iam]
@username = 'fake_user'
@ -50,6 +49,8 @@ Shindo.tests("Fog::Compute[:iam] | policies", ['aws','iam']) do
end
# clean up
@user.access_keys.map(&:destroy)
@user.policies.map(&:destroy)
@user.destroy

View file

@ -1,6 +1,5 @@
Shindo.tests("Fog::Compute[:iam] | users", ['aws','iam']) do
Fog.mock!
@iam = Fog::AWS[:iam]
@user_one_name = 'fake_user_one'
@user_two_name = 'fake_user_two'
@ -9,17 +8,21 @@ Shindo.tests("Fog::Compute[:iam] | users", ['aws','iam']) do
@user_three_path = '/path/to/fake_user_three/'
@user_four_name = 'fake_user_four'
def all_users
@iam.users.all.select{|user| user.id =~ /^fake_user/ }
end
tests('#create').succeeds do
@user_one = @iam.users.create(:id => @user_one_name)
@user_one.id == @user_one_name
end
tests('#all','there is only one user').succeeds do
@iam.users.size == 1
all_users.size == 1
end
tests('#all','the only user should match').succeeds do
@iam.users.first.id == @user_one_name
all_users.first.id == @user_one_name
end
tests('#create','a second user').succeeds do
@ -28,7 +31,7 @@ Shindo.tests("Fog::Compute[:iam] | users", ['aws','iam']) do
end
tests('#all','there are two users').succeeds do
@iam.users.size == 2
all_users.size == 2
end
tests('#get','an existing user').succeeds do