'Get the first project ID accessible with the specified access token'

def _get_project_id(self, token):

    path = '/v3/OS-FEDERATION/projects'
    response = self.request(path, headers={'Content-Type': 'application/json', 'X-Auth-Token': token}, method='GET')
    if (response.status == httplib.UNAUTHORIZED):
        raise InvalidCredsError()
    elif (response.status in [httplib.OK, httplib.CREATED]):
        try:
            body = json.loads(response.body)
            return body['projects'][0]['id']
        except Exception:
            e = sys.exc_info()[1]
            raise MalformedResponseError('Failed    to    parse    JSON', e)
    else:
        raise MalformedResponseError('Malformed    response', driver=self.driver)
