From ba6ecbe3cbe236de21ba31b3af7e10980830696a Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Fri, 30 Mar 2012 14:34:14 +0100 Subject: [PATCH] Export user id as password to keystone when using noauth Fixes bug #969208 When using noauth, a user's password is her user id (e.g. in novarc). When we export to keystone, we should make sure the same credentials keep working rather than effectively switching all the passwords to random UUIDs which users would never have seen before. Change-Id: Ie77c622ce1952d03e836bb64167184022a02e902 --- bin/nova-manage | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/nova-manage b/bin/nova-manage index 65082ba9..462b9d5e 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -1542,16 +1542,23 @@ class ExportCommands(object): am = manager.AuthManager() for user in am.get_users(): + # NOTE(vish): Deprecated auth uses an access key, no auth uses a + # the user_id in place of it. + if FLAGS.auth_strategy == 'deprecated': + access = user.access + else: + access = user.id + user_dict = { 'id': user.id, 'name': user.name, - 'password': user.access, + 'password': access, } output['users'].append(user_dict) ec2_cred = { 'user_id': user.id, - 'access_key': user.access, + 'access_key': access, 'secret_key': user.secret, } output['ec2_credentials'].append(ec2_cred)