diff --git a/lib/fog/rackspace/models/identity/users.rb b/lib/fog/rackspace/models/identity/users.rb index 526629f37..646dadf31 100644 --- a/lib/fog/rackspace/models/identity/users.rb +++ b/lib/fog/rackspace/models/identity/users.rb @@ -18,7 +18,7 @@ module Fog new(data) rescue Excon::Errors::NotFound nil - rescue Excon::Errors::NotAuthorized + rescue Excon::Errors::Unauthorized nil end @@ -27,7 +27,7 @@ module Fog new(data) rescue Excon::Errors::NotFound nil - rescue Excon::Errors::NotAuthorized + rescue Excon::Errors::Unauthorized nil end end diff --git a/tests/rackspace/requests/identity/user_tests.rb b/tests/rackspace/requests/identity/user_tests.rb index 62803beb0..20026474b 100644 --- a/tests/rackspace/requests/identity/user_tests.rb +++ b/tests/rackspace/requests/identity/user_tests.rb @@ -41,7 +41,7 @@ Shindo.tests('Fog::Rackspace::Identity | users', ['rackspace']) do service = Fog::Rackspace::Identity.new id = nil - username = 'foguser' + username = "fog#{Time.now.to_i.to_s}" email = 'fog_user@example.com' enabled = true password = 'Fog_password1' @@ -57,6 +57,9 @@ Shindo.tests('Fog::Rackspace::Identity | users', ['rackspace']) do service.delete_user(id) end + # there appears to be a werid caching issue. It's just easier to create a new username and continue on + username = "fog#{Time.now.to_i.to_s}" + tests('#create_user with password').succeeds do data = service.create_user(username, email, enabled, :password => password ).body id = data['user']['id']