summaryrefslogtreecommitdiffstats
path: root/nova/auth
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-08-23 12:21:52 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2011-08-23 12:21:52 -0700
commita5fd82841bfada1b59066d82094f41ffa9389dec (patch)
tree82d800cf0e76fbb161c0f4a332158ded25b12040 /nova/auth
parent787913ddedce4f3395b4e3d5073a0eea259ed9f7 (diff)
downloadnova-a5fd82841bfada1b59066d82094f41ffa9389dec.tar.gz
nova-a5fd82841bfada1b59066d82094f41ffa9389dec.tar.xz
nova-a5fd82841bfada1b59066d82094f41ffa9389dec.zip
fix for rc generation using noauth.
Diffstat (limited to 'nova/auth')
-rw-r--r--nova/auth/manager.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/nova/auth/manager.py b/nova/auth/manager.py
index 85227bea0..44e6e11ac 100644
--- a/nova/auth/manager.py
+++ b/nova/auth/manager.py
@@ -41,10 +41,13 @@ from nova.auth import signer
FLAGS = flags.FLAGS
+flags.DEFINE_bool('use_deprecated_auth',
+ False,
+ 'This flag must be set to use old style auth')
+
flags.DEFINE_list('allowed_roles',
['cloudadmin', 'itsec', 'sysadmin', 'netadmin', 'developer'],
'Allowed roles for project')
-
# NOTE(vish): a user with one of these roles will be a superuser and
# have access to all api commands
flags.DEFINE_list('superuser_roles', ['cloudadmin'],
@@ -814,7 +817,13 @@ class AuthManager(object):
s3_host = host
ec2_host = host
rc = open(FLAGS.credentials_template).read()
- rc = rc % {'access': user.access,
+ # NOTE(vish): Deprecated auth uses an access key, no auth uses a
+ # the user_id in place of it.
+ if FLAGS.use_deprecated_auth:
+ access = user.access
+ else:
+ access = user.id
+ rc = rc % {'access': access,
'project': pid,
'secret': user.secret,
'ec2': '%s://%s:%s%s' % (FLAGS.ec2_scheme,