~ubuntu-branches/ubuntu/trusty/python-keystoneclient/trusty-proposed

« back to all changes in this revision

Viewing changes to keystoneclient/v3/client.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2013-11-14 10:51:32 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20131114105132-p1o428l7fclasv9e
Tags: 1:0.4.1-0ubuntu1
[ Adam Gandelman ]
* debian/patches: Refreshed.
* debian/patches/use-mox-dependency.patch: Use mox instead of mox3
  dependency.

[ Chuck Short ]
* New upstream release.
* debian/control:
  - open icehouse release.
  - Dropped python-d2to1 and python-httplib2 dependency.
* debian/patches/skip-tests-ubuntu.patch: Dropped no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
13
#    License for the specific language governing permissions and limitations
14
14
#    under the License.
15
 
import json
16
15
import logging
17
16
 
18
17
from keystoneclient import exceptions
19
18
from keystoneclient import httpclient
 
19
from keystoneclient.openstack.common import jsonutils
20
20
from keystoneclient.v3.contrib import trusts
21
21
from keystoneclient.v3 import credentials
22
22
from keystoneclient.v3 import domains
104
104
            self.authenticate()
105
105
 
106
106
    def serialize(self, entity):
107
 
        return json.dumps(entity, sort_keys=True)
 
107
        return jsonutils.dumps(entity, sort_keys=True)
108
108
 
109
109
    def process_token(self):
110
110
        """Extract and process information from the new auth_ref.
170
170
                 project_id=None, project_name=None, project_domain_id=None,
171
171
                 project_domain_name=None, token=None, trust_id=None):
172
172
        headers = {}
 
173
        if auth_url is None:
 
174
            raise ValueError("Cannot authenticate without a valid auth_url")
173
175
        url = auth_url + "/auth/tokens"
174
176
        body = {'auth': {'identity': {}}}
175
177
        ident = body['auth']['identity']