~0x44/nova/bug838466

« back to all changes in this revision

Viewing changes to nova/auth/manager.py

  • Committer: Tarmac
  • Author(s): Vishvananda Ishaya
  • Date: 2011-08-23 21:19:44 UTC
  • mfrom: (1479.2.2 lp831995)
  • Revision ID: tarmac-20110823211944-av0no2f984kmk4w2
Adds a use_deprecated_auth flag to make sure creds generated using nova-manage commands will work with noauth.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
 
43
43
FLAGS = flags.FLAGS
 
44
flags.DEFINE_bool('use_deprecated_auth',
 
45
                  False,
 
46
                  'This flag must be set to use old style auth')
 
47
 
44
48
flags.DEFINE_list('allowed_roles',
45
49
                  ['cloudadmin', 'itsec', 'sysadmin', 'netadmin', 'developer'],
46
50
                  'Allowed roles for project')
47
 
 
48
51
# NOTE(vish): a user with one of these roles will be a superuser and
49
52
#             have access to all api commands
50
53
flags.DEFINE_list('superuser_roles', ['cloudadmin'],
814
817
            s3_host = host
815
818
            ec2_host = host
816
819
        rc = open(FLAGS.credentials_template).read()
817
 
        rc = rc % {'access': user.access,
 
820
        # NOTE(vish): Deprecated auth uses an access key, no auth uses a
 
821
        #             the user_id in place of it.
 
822
        if FLAGS.use_deprecated_auth:
 
823
            access = user.access
 
824
        else:
 
825
            access = user.id
 
826
        rc = rc % {'access': access,
818
827
                   'project': pid,
819
828
                   'secret': user.secret,
820
829
                   'ec2': '%s://%s:%s%s' % (FLAGS.ec2_scheme,