Skip to content

Commit

Permalink
fix code review concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
Tokunbo committed Feb 18, 2015
1 parent 8a571d6 commit 6cd33ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions mimic/rest/auth_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def rax_kskey_apikeycredentials(self, request, user_id):
"""
Support, such as it is, for the apiKeysCredentials call.
"""
username = None
if user_id in self.core.sessions._userid_to_session:
username = self.core.sessions._userid_to_session[user_id].username.decode('ascii')
apikey = '7fc56270e7a70fa81a5935b72eacbe29' # echo -n A | md5sum
Expand All @@ -139,7 +138,7 @@ def rax_kskey_apikeycredentials(self, request, user_id):
else:
request.setResponseCode(404)
return json.dumps({'itemNotFound':
{'code': 404, 'message': 'User '+user_id+' not found'}})
{'code': 404, 'message': 'User ' + user_id + ' not found'}})

@app.route('/v2.0/RAX-AUTH/impersonation-tokens', methods=['POST'])
def get_impersonation_token(self, request):
Expand Down
2 changes: 1 addition & 1 deletion mimic/test/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ def test_rax_kskey_apikeycredentials(self):
username = json_body['access']['user']['name']
(response, json_body) = self.successResultOf(json_request(
self, root, "GET",
"/identity/v2.0/users/"+user_id+"/OS-KSADM/credentials/RAX-KSKEY:apiKeyCredentials"
"/identity/v2.0/users/" + user_id + "/OS-KSADM/credentials/RAX-KSKEY:apiKeyCredentials"
))
self.assertEqual(response.code, 200)
self.assertEqual(json_body['RAX-KSKEY:apiKeyCredentials']['username'],
Expand Down

0 comments on commit 6cd33ef

Please sign in to comment.