~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to nova/endpoint/images.py

  • Committer: Ewan Mellor
  • Date: 2010-08-09 11:10:27 UTC
  • mfrom: (212 trunk)
  • mto: (145.4.1 add-contains)
  • mto: This revision was merged to the branch mainline in revision 221.
  • Revision ID: ewan.mellor@citrix.com-20100809111027-xbdyu44l6nb68bvp
Merged with trunk again.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
from nova import flags
29
29
from nova import utils
 
30
from nova.auth import manager
30
31
 
31
32
 
32
33
FLAGS = flags.FLAGS
75
76
            query_args=qs({'image_id': image_id}))
76
77
 
77
78
def conn(context):
78
 
    return boto.s3.connection.S3Connection (
79
 
        aws_access_key_id=str('%s:%s' % (context.user.access, context.project.name)),
80
 
        aws_secret_access_key=str(context.user.secret),
81
 
        is_secure=False,
82
 
        calling_format=boto.s3.connection.OrdinaryCallingFormat(),
83
 
        port=FLAGS.s3_port,
84
 
        host=FLAGS.s3_host)
 
79
    access = manager.AuthManager().get_access_key(context.user,
 
80
                                                  context.project)
 
81
    secret = str(context.user.secret)
 
82
    calling = boto.s3.connection.OrdinaryCallingFormat()
 
83
    return boto.s3.connection.S3Connection(aws_access_key_id=access,
 
84
                                           aws_secret_access_key=secret,
 
85
                                           is_secure=False,
 
86
                                           calling_format=calling,
 
87
                                           port=FLAGS.s3_port,
 
88
                                           host=FLAGS.s3_host)
85
89
 
86
90
 
87
91
def qs(params):