~ubuntu-branches/ubuntu/trusty/heat/trusty

« back to all changes in this revision

Viewing changes to heat/common/context.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2013-09-08 21:51:19 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130908215119-r939tu4aumqgdrkx
Tags: 2013.2~b3-0ubuntu1
[ Chuck Short ]
* New upstream release.
* debian/control: Add python-netaddr as build-dep.
* debian/heat-common.install: Remove heat-boto and associated man-page
* debian/heat-common.install: Remove heat-cfn and associated man-page
* debian/heat-common.install: Remove heat-watch and associated man-page
* debian/patches/fix-sqlalchemy-0.8.patch: Dropped

[ Adam Gandelman ]
* debian/patches/default-kombu.patch: Dropped.
* debian/patches/default-sqlite.patch: Refreshed.
* debian/*.install, rules: Install heat.conf.sample as common
  config file in heat-common. Drop other per-package configs, they
  are no longer used.
* debian/rules: Clean pbr .egg from build dir if it exists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    """
36
36
 
37
37
    def __init__(self, auth_token=None, username=None, password=None,
38
 
                 aws_creds=None, aws_auth_uri=None, tenant=None,
 
38
                 aws_creds=None, tenant=None,
39
39
                 tenant_id=None, auth_url=None, roles=None, is_admin=False,
40
40
                 read_only=False, show_deleted=False,
41
 
                 owner_is_tenant=True, overwrite=True, **kwargs):
 
41
                 owner_is_tenant=True, overwrite=True,
 
42
                 trust_id=None, trustor_user_id=None,
 
43
                 **kwargs):
42
44
        """
43
45
        :param overwrite: Set to False to ensure that the greenthread local
44
46
            copy of the index is not overwritten.
56
58
        self.username = username
57
59
        self.password = password
58
60
        self.aws_creds = aws_creds
59
 
        self.aws_auth_uri = aws_auth_uri
60
61
        self.tenant_id = tenant_id
61
62
        self.auth_url = auth_url
62
63
        self.roles = roles or []
64
65
        if overwrite or not hasattr(local.store, 'context'):
65
66
            self.update_store()
66
67
        self._session = None
 
68
        self.trust_id = trust_id
 
69
        self.trustor_user_id = trustor_user_id
67
70
 
68
71
    def update_store(self):
69
72
        local.store.context = self
79
82
                'username': self.user,
80
83
                'password': self.password,
81
84
                'aws_creds': self.aws_creds,
82
 
                'aws_auth_uri': self.aws_auth_uri,
83
85
                'tenant': self.tenant,
84
86
                'tenant_id': self.tenant_id,
 
87
                'trust_id': self.trust_id,
 
88
                'trustor_user_id': self.trustor_user_id,
85
89
                'auth_url': self.auth_url,
86
90
                'roles': self.roles,
87
91
                'is_admin': self.is_admin}
157
161
            username = None
158
162
            password = None
159
163
            aws_creds = None
160
 
            aws_auth_uri = None
161
164
 
162
165
            if headers.get('X-Auth-User') is not None:
163
166
                username = headers.get('X-Auth-User')
164
167
                password = headers.get('X-Auth-Key')
165
168
            elif headers.get('X-Auth-EC2-Creds') is not None:
166
169
                aws_creds = headers.get('X-Auth-EC2-Creds')
167
 
                aws_auth_uri = headers.get('X-Auth-EC2-Url')
168
170
 
169
171
            token = headers.get('X-Auth-Token')
170
172
            tenant = headers.get('X-Tenant-Name')
180
182
        req.context = self.make_context(auth_token=token,
181
183
                                        tenant=tenant, tenant_id=tenant_id,
182
184
                                        aws_creds=aws_creds,
183
 
                                        aws_auth_uri=aws_auth_uri,
184
185
                                        username=username,
185
186
                                        password=password,
186
187
                                        auth_url=auth_url, roles=roles,