From c794bdfafe8d29b1dd9b9ea038bac9ab4e266ef3 Mon Sep 17 00:00:00 2001 From: Sandy Walsh Date: Wed, 15 Jun 2011 09:48:24 -0700 Subject: [PATCH] trunk merge --- docs/conf.py | 2 +- docs/releases.rst | 8 ++++++++ novaclient/client.py | 8 ++++++-- novaclient/shell.py | 2 ++ setup.py | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6fc27e094..34576db68 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -47,7 +47,7 @@ copyright = u'Rackspace, based on work by Jacob Kaplan-Moss' # The short X.Y version. version = '2.5' # The full version, including alpha/beta/rc tags. -release = '2.5.1' +release = '2.5.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/releases.rst b/docs/releases.rst index c8a820566..02eaabeda 100644 --- a/docs/releases.rst +++ b/docs/releases.rst @@ -2,6 +2,14 @@ Release notes ============= +2.5.2 (June 15, 2011) +===================== +* ProjectID can be None for backwards compatability. + +2.5.1 (June 10, 2011) +===================== +* ProjectID now part of authentication + 2.5.0 (June 3, 2011) ================= diff --git a/novaclient/client.py b/novaclient/client.py index 06c21e44e..cf3555fc5 100644 --- a/novaclient/client.py +++ b/novaclient/client.py @@ -91,7 +91,8 @@ class OpenStackClient(httplib2.Http): # re-authenticate and try again. If it still fails, bail. try: kwargs.setdefault('headers', {})['X-Auth-Token'] = self.auth_token - kwargs['headers']['X-Auth-Project-Id'] = self.projectid + if self.projectid: + kwargs['headers']['X-Auth-Project-Id'] = self.projectid resp, body = self.request(self.management_url + url, method, **kwargs) @@ -119,7 +120,10 @@ class OpenStackClient(httplib2.Http): return self._cs_request(url, 'DELETE', **kwargs) def authenticate(self): - headers = {'X-Auth-User': self.user, 'X-Auth-Key': self.apikey, 'X-Auth-Project-Id': self. projectid} + headers = {'X-Auth-User': self.user, + 'X-Auth-Key': self.apikey} + if self.projectid: + headers['X-Auth-Project-Id'] = self.projectid resp, body = self.request(self.auth_url, 'GET', headers=headers) self.management_url = resp['x-server-management-url'] self.auth_token = resp['x-auth-token'] diff --git a/novaclient/shell.py b/novaclient/shell.py index 3e087e966..b937a969c 100644 --- a/novaclient/shell.py +++ b/novaclient/shell.py @@ -150,8 +150,10 @@ class OpenStackShell(object): httplib2.debuglevel = 1 user, apikey, projectid, url = args.username, args.apikey, args.projectid, args.url + #FIXME(usrleon): Here should be restrict for project id same as for username or apikey # but for compatibility it is not. + if not user: raise CommandError("You must provide a username, either via " "--username or via env[NOVA_USERNAME]") diff --git a/setup.py b/setup.py index 6bd6ec9cf..c730f7c72 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ if sys.version_info < (2,6): setup( name = "python-novaclient", - version = "2.5.1", + version = "2.5.2", description = "Client library for OpenStack Nova API", long_description = read('README.rst'), url = 'https://github.com/rackspace/python-novaclient',