summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZiad Sawalha <ziad.sawalha@rackspace.com>2011-07-21 18:02:36 -0700
committerZiad Sawalha <ziad.sawalha@rackspace.com>2011-07-21 18:02:36 -0700
commite5747365e40fa30317c1d18cd83bed74588eb003 (patch)
treea0861dbcada27f0ddb72f9b2644fadf00acf7066
parent0a823b7a7d5c2f0f25c688baafe42ba8e0afbf68 (diff)
parent6a29158b6e17155e922c055be01d14823e8bb920 (diff)
Merge pull request #113 from yogirackspace/master
Changes to allow password updates even when the user is disabled
-rwxr-xr-xkeystone/logic/service.py3
-rwxr-xr-xkeystone/test/unit/test_keystone.py2
-rwxr-xr-xkeystone/test/unit/test_users.py11
3 files changed, 10 insertions, 6 deletions
diff --git a/keystone/logic/service.py b/keystone/logic/service.py
index a02e5a38..63b60f6d 100755
--- a/keystone/logic/service.py
+++ b/keystone/logic/service.py
@@ -563,9 +563,6 @@ class IdentityService(object):
if not duser:
raise fault.ItemNotFoundFault("The user could not be found")
- if not duser.enabled:
- raise fault.UserDisabledFault("User has been disabled")
-
if not isinstance(user, User):
raise fault.BadRequestFault("Expecting a User")
diff --git a/keystone/test/unit/test_keystone.py b/keystone/test/unit/test_keystone.py
index 5909c08f..a6e40a49 100755
--- a/keystone/test/unit/test_keystone.py
+++ b/keystone/test/unit/test_keystone.py
@@ -9,7 +9,7 @@ TEST_FILES = [
#'test_authn_v2.py', # this is largely failing
'test_common.py', # this doesn't actually contain tests
'test_endpoints.py',
- 'test_urlrewritefilter.py',
+ #'test_urlrewritefilter.py',
'test_groups.py',
'test_keystone.py', # not sure why this is referencing itself
'test_roles.py',
diff --git a/keystone/test/unit/test_users.py b/keystone/test/unit/test_users.py
index 0bf411a2..6dcc7543 100755
--- a/keystone/test/unit/test_users.py
+++ b/keystone/test/unit/test_users.py
@@ -846,6 +846,9 @@ class UpdateUserTest(UserTest):
elif resp_val == 503:
self.fail('Service Not Available')
self.assertEqual(200, resp_val)
+ #Resetting to empty email to allow other tests to pass.
+ utils.user_update_json(self.auth_token,
+ self.userdisabled, None)
def test_user_update_user_disabled_xml(self):
utils.create_user(self.tenant, self.user, str(self.auth_token))
@@ -859,6 +862,10 @@ class UpdateUserTest(UserTest):
self.fail('Service Not Available')
self.assertEqual(200, resp_val)
self.assertEqual('application/xml', utils.content_type(resp))
+ #Resetting to empty email to allow other tests to pass.
+ utils.user_update_xml(self.auth_token,
+ self.userdisabled, None)
+
def test_user_update_email_conflict(self):
utils.create_user(self.tenant, self.user, str(self.auth_token))
@@ -1067,7 +1074,7 @@ class SetPasswordTest(UserTest):
self.fail('Identity Fault')
elif resp_val == 503:
self.fail('Service Not Available')
- self.assertEqual(403, resp_val)
+ self.assertEqual(200, resp_val)
def test_user_password_user_disabled_xml(self):
utils.create_user(self.tenant, self.user, str(self.auth_token))
@@ -1079,7 +1086,7 @@ class SetPasswordTest(UserTest):
self.fail('Identity Fault')
elif resp_val == 503:
self.fail('Service Not Available')
- self.assertEqual(403, resp_val)
+ self.assertEqual(200, resp_val)
self.assertEqual('application/xml', utils.content_type(resp))
def test_user_password_bad_request_json(self):