← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1529193] [NEW] ec2 credentials create broken in python3

 

Public bug reported:

When I run tools/sample_data.sh, it crashed.

And the server log is:

2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi Traceback (most recent call last):
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi   File "/home/zsj/Workspace/umcloud/openstack/keystone/keystone/common/wsgi.py", line 247, in __call__
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi     result = method(context, **params)
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi   File "/home/zsj/Workspace/umcloud/openstack/keystone/keystone/contrib/ec2/controllers.py", line 302, in create_credential
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi     tenant_id)
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi   File "/home/zsj/Workspace/umcloud/openstack/keystone/keystone/contrib/ec2/controllers.py", line 182, in create_credential
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi     credential_id = utils.hash_access_key(blob['access'])
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi   File "/home/zsj/Workspace/umcloud/openstack/keystone/keystone/common/utils.py", line 118, in hash_access_key
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi     hash_.update(access)
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi TypeError: Unicode-objects must be encoded before hashing
2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi


related files are:
https://github.com/openstack/keystone/blob/507003981206440313cc6fd692ef58c748742435/keystone/contrib/ec2/controllers.py#L182 
https://github.com/openstack/keystone/blob/507003981206440313cc6fd692ef58c748742435/keystone/common/utils.py#L118

It will call  utils.hash_access_key to generate a hash.
However it passes a  Unicode-objects to the function.

** Affects: keystone
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1529193

Title:
  ec2 credentials create broken in python3

Status in OpenStack Identity (keystone):
  New

Bug description:
  When I run tools/sample_data.sh, it crashed.

  And the server log is:

  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi Traceback (most recent call last):
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi   File "/home/zsj/Workspace/umcloud/openstack/keystone/keystone/common/wsgi.py", line 247, in __call__
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi     result = method(context, **params)
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi   File "/home/zsj/Workspace/umcloud/openstack/keystone/keystone/contrib/ec2/controllers.py", line 302, in create_credential
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi     tenant_id)
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi   File "/home/zsj/Workspace/umcloud/openstack/keystone/keystone/contrib/ec2/controllers.py", line 182, in create_credential
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi     credential_id = utils.hash_access_key(blob['access'])
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi   File "/home/zsj/Workspace/umcloud/openstack/keystone/keystone/common/utils.py", line 118, in hash_access_key
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi     hash_.update(access)
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi TypeError: Unicode-objects must be encoded before hashing
  2015-12-25 15:22:50.568 32700 ERROR keystone.common.wsgi

  
  related files are:
  https://github.com/openstack/keystone/blob/507003981206440313cc6fd692ef58c748742435/keystone/contrib/ec2/controllers.py#L182 
  https://github.com/openstack/keystone/blob/507003981206440313cc6fd692ef58c748742435/keystone/common/utils.py#L118

  It will call  utils.hash_access_key to generate a hash.
  However it passes a  Unicode-objects to the function.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1529193/+subscriptions


Follow ups