diff --git a/.gitignore b/.gitignore index 291e6f1..5d70505 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -/python-glanceclient-0.4.1.tar.gz -/python-glanceclient-0.5.1.tar.gz +/python-glanceclient-0.6.0.tar.gz diff --git a/0001-Hook-up-region_name-argument.patch b/0001-Hook-up-region_name-argument.patch new file mode 100644 index 0000000..e900433 --- /dev/null +++ b/0001-Hook-up-region_name-argument.patch @@ -0,0 +1,49 @@ +From 3003ed8ef8078e97a2deeaf1f561292a3708755c Mon Sep 17 00:00:00 2001 +From: Brian Waldon +Date: Mon, 19 Nov 2012 12:47:54 -0800 +Subject: [PATCH] Hook up region_name argument + +Connect the --os-region-name option passed through the CLI +to the call to service_catalog.url_for. + +Fixes bug 1080739. + +Change-Id: I2d19d62a999a82a91de3883db12bbc24e900de25 +--- + glanceclient/shell.py | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/glanceclient/shell.py b/glanceclient/shell.py +index 99991eb..17ad33d 100644 +--- a/glanceclient/shell.py ++++ b/glanceclient/shell.py +@@ -311,9 +311,16 @@ class OpenStackImagesShell(object): + + def _get_endpoint(self, client, **kwargs): + """Get an endpoint using the provided keystone client.""" +- endpoint = client.service_catalog.url_for( +- service_type=kwargs.get('service_type') or 'image', +- endpoint_type=kwargs.get('endpoint_type') or 'publicURL') ++ endpoint_kwargs = { ++ 'service_type': kwargs.get('service_type') or 'image', ++ 'endpoint_type': kwargs.get('endpoint_type') or 'publicURL', ++ } ++ ++ if kwargs.get('region_name'): ++ endpoint_kwargs['attr'] = 'region' ++ endpoint_kwargs['filter_value'] = kwargs.get('region_name') ++ ++ endpoint = client.service_catalog.url_for(**endpoint_kwargs) + return self._strip_version(endpoint) + + def _get_image_url(self, args): +@@ -389,7 +396,8 @@ class OpenStackImagesShell(object): + 'auth_url': args.os_auth_url, + 'service_type': args.os_service_type, + 'endpoint_type': args.os_endpoint_type, +- 'insecure': args.insecure ++ 'insecure': args.insecure, ++ 'region_name': args.os_region_name, + } + _ksclient = self._get_ksclient(**kwargs) + token = args.os_auth_token or _ksclient.auth_token diff --git a/0001-Make-ConnectionRefused-error-more-informative.patch b/0001-Make-ConnectionRefused-error-more-informative.patch deleted file mode 100644 index d27871f..0000000 --- a/0001-Make-ConnectionRefused-error-more-informative.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 8cee48b1ddf480d182bbc33ec684dcfd195b038c Mon Sep 17 00:00:00 2001 -From: Andrew Laski -Date: Wed, 12 Sep 2012 09:40:04 -0400 -Subject: [PATCH] Make ConnectionRefused error more informative. - -When the server refuses the connection the error message displayed now -lists the endpoint that refused the connection. - -Fixes: bug 1043067 -Change-Id: I62797106732bbb6eec8c99e491fd38850ad58ff8 ---- - glanceclient/common/http.py | 3 +- - tests/test_http.py | 55 +++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 57 insertions(+), 1 deletions(-) - create mode 100644 tests/test_http.py - -diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py -index d81ac9a..4349e86 100644 ---- a/glanceclient/common/http.py -+++ b/glanceclient/common/http.py -@@ -140,7 +140,8 @@ class HTTPClient(object): - message = "Error finding address for %(url)s: %(e)s" % locals() - raise exc.InvalidEndpoint(message=message) - except (socket.error, socket.timeout) as e: -- message = "Error communicating with %(url)s: %(e)s" % locals() -+ endpoint = self.endpoint -+ message = "Error communicating with %(endpoint)s %(e)s" % locals() - raise exc.CommunicationError(message=message) - - body_iter = ResponseBodyIterator(resp) -diff --git a/tests/test_http.py b/tests/test_http.py -new file mode 100644 -index 0000000..c727c6a ---- /dev/null -+++ b/tests/test_http.py -@@ -0,0 +1,55 @@ -+# Copyright 2012 OpenStack LLC. -+# All Rights Reserved. -+# -+# Licensed under the Apache License, Version 2.0 (the "License"); you may -+# not use this file except in compliance with the License. You may obtain -+# a copy of the License at -+# -+# http://www.apache.org/licenses/LICENSE-2.0 -+# -+# Unless required by applicable law or agreed to in writing, software -+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -+# License for the specific language governing permissions and limitations -+# under the License. -+ -+import httplib -+import socket -+import unittest -+ -+import mox -+ -+from glanceclient import exc -+from glanceclient.common import http -+ -+ -+class TestClient(unittest.TestCase): -+ def test_connection_refused(self): -+ """ -+ Should receive a CommunicationError if connection refused. -+ And the error should list the host and port that refused the -+ connection -+ """ -+ endpoint = 'http://example.com:9292' -+ client = http.HTTPClient(endpoint, token=u'abc123') -+ m = mox.Mox() -+ m.StubOutWithMock(httplib.HTTPConnection, 'request') -+ httplib.HTTPConnection.request( -+ mox.IgnoreArg(), -+ mox.IgnoreArg(), -+ headers=mox.IgnoreArg(), -+ ).AndRaise(socket.error()) -+ m.ReplayAll() -+ try: -+ client.json_request('GET', '/v1/images/detail?limit=20') -+ #NOTE(alaski) We expect exc.CommunicationError to be raised -+ # so we should never reach this point. try/except is used here -+ # rather than assertRaises() so that we can check the body of -+ # the exception. -+ self.fail('An exception should have bypassed this line.') -+ except exc.CommunicationError, comm_err: -+ fail_msg = ("Exception message '%s' should contain '%s'" % -+ (comm_err.message, endpoint)) -+ self.assertTrue(endpoint in comm_err.message, fail_msg) -+ finally: -+ m.UnsetStubs() diff --git a/0002-Fix-weird-None-displayed-on-some-errors.patch b/0002-Fix-weird-None-displayed-on-some-errors.patch deleted file mode 100644 index 0a7f92c..0000000 --- a/0002-Fix-weird-None-displayed-on-some-errors.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 902bff79bbe52e831da947bb5ac5fce2330d810e Mon Sep 17 00:00:00 2001 -From: Vincent Untz -Date: Thu, 13 Sep 2012 11:12:00 +0200 -Subject: [PATCH] Fix weird "None" displayed on some errors - -logging.exception() should only be called from an exception handler, -which is not the case here. - -Part of bug 1050260. - -Change-Id: I591a68c458cd733c04cea7d2d640afdbb7dd19f6 ---- - glanceclient/common/http.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py -index 4349e86..4a6ce53 100644 ---- a/glanceclient/common/http.py -+++ b/glanceclient/common/http.py -@@ -155,7 +155,7 @@ class HTTPClient(object): - self.log_http_response(resp) - - if 400 <= resp.status < 600: -- LOG.exception("Request returned failure status.") -+ LOG.error("Request returned failure status.") - raise exc.from_response(resp) - elif resp.status in (301, 302, 305): - # Redirected. Reissue the request to the new location. diff --git a/0002-adjust-egg-info-for-Fedora.patch b/0002-adjust-egg-info-for-Fedora.patch new file mode 100644 index 0000000..8b29af8 --- /dev/null +++ b/0002-adjust-egg-info-for-Fedora.patch @@ -0,0 +1,22 @@ +From f6c6c25911c129917e5e0545e59a3b9d014ba33c Mon Sep 17 00:00:00 2001 +From: Alan Pevec +Date: Thu, 23 Aug 2012 01:35:20 +0200 +Subject: [PATCH] adjust egg info for Fedora + +There is no egg info available for argparse on Fedora +so the requirement can't be satisfied. + +FEDORA SPECIFIC - do not send upstream! +--- + tools/pip-requires | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tools/pip-requires b/tools/pip-requires +index 8926c42..c67a7ac 100644 +--- a/tools/pip-requires ++++ b/tools/pip-requires +@@ -1,4 +1,3 @@ +-argparse + prettytable>=0.6,<0.7 + python-keystoneclient>=0.1.2,<1 + pyOpenSSL diff --git a/0003-Typo-in-image-create-help-page.patch b/0003-Typo-in-image-create-help-page.patch deleted file mode 100644 index 9ca9450..0000000 --- a/0003-Typo-in-image-create-help-page.patch +++ /dev/null @@ -1,31 +0,0 @@ -From cdc94af297fe56341dfe0484d62f2e69d9aa5e9b Mon Sep 17 00:00:00 2001 -From: Stuart McLaren -Date: Mon, 17 Sep 2012 13:39:33 +0000 -Subject: [PATCH] Typo in image-create help page - -The image-create help page reversed the DISK_FORMAT -and CONTAINER_FORMAT metavars. - -Fixes bug 1051968. - -Change-Id: I385cb0912ad87a62fd10742b5da23a5ea8bc9bb8 ---- - glanceclient/v1/shell.py | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py -index 3646f9f..500014c 100644 ---- a/glanceclient/v1/shell.py -+++ b/glanceclient/v1/shell.py -@@ -92,9 +92,9 @@ def do_image_download(gc, args): - help='ID of image to reserve.') - @utils.arg('--name', metavar='', - help='Name of image.') --@utils.arg('--disk-format', metavar='', -+@utils.arg('--disk-format', metavar='', - help='Disk format of image.') --@utils.arg('--container-format', metavar='', -+@utils.arg('--container-format', metavar='', - help='Container format of image.') - @utils.arg('--owner', metavar='', - help='Tenant who should own image.') diff --git a/0004-adjust-egg-info-for-Fedora.patch b/0004-adjust-egg-info-for-Fedora.patch deleted file mode 100644 index 6a0e429..0000000 --- a/0004-adjust-egg-info-for-Fedora.patch +++ /dev/null @@ -1,22 +0,0 @@ -From b248b76d6c404578b625efc4b190161b12d9510e Mon Sep 17 00:00:00 2001 -From: Alan Pevec -Date: Thu, 23 Aug 2012 01:35:20 +0200 -Subject: [PATCH] adjust egg info for Fedora - -There is no egg info available for argparse on Fedora -so the requirement can't be satisfied. - -FEDORA SPECIFIC - do not send upstream! ---- - tools/pip-requires | 1 - - 1 files changed, 0 insertions(+), 1 deletions(-) - -diff --git a/tools/pip-requires b/tools/pip-requires -index bbb4edf..69367c6 100644 ---- a/tools/pip-requires -+++ b/tools/pip-requires -@@ -1,4 +1,3 @@ --argparse - prettytable>=0.6,<0.7 - python-keystoneclient>=0.1.2,<0.2 - warlock<2 diff --git a/python-glanceclient.spec b/python-glanceclient.spec index f3923a3..d1c9a16 100644 --- a/python-glanceclient.spec +++ b/python-glanceclient.spec @@ -3,7 +3,7 @@ Name: python-glanceclient # and restarted version numbering from 0.1.1 # https://lists.launchpad.net/openstack/msg14248.html Epoch: 1 -Version: 0.5.1 +Version: 0.6.0 Release: 1%{?dist} Summary: Python API and CLI for OpenStack Glance @@ -14,12 +14,10 @@ URL: http://github.com/openstack/python-glanceclient Source0: http://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz # -# patches_base=0.5.1 +# patches_base=0.6.0 # -Patch0001: 0001-Make-ConnectionRefused-error-more-informative.patch -Patch0002: 0002-Fix-weird-None-displayed-on-some-errors.patch -Patch0003: 0003-Typo-in-image-create-help-page.patch -Patch0004: 0004-adjust-egg-info-for-Fedora.patch +Patch0001: 0001-Hook-up-region_name-argument.patch +Patch0002: 0002-adjust-egg-info-for-Fedora.patch BuildArch: noarch BuildRequires: python-setuptools @@ -38,10 +36,6 @@ glanceclient module), and a command-line script (glance). Each implements %prep %setup -q -%patch0001 -p1 -%patch0002 -p1 -%patch0003 -p1 -%patch0004 -p1 # Remove bundled egg-info rm -rf python_glanceclient.egg-info @@ -53,6 +47,9 @@ sed -i '/setuptools-git/d' setup.py %install %{__python} setup.py install -O1 --skip-build --root %{buildroot} +# move versioninfo https://review.openstack.org/15962 +mv %{buildroot}/usr/glanceclient/versioninfo %{buildroot}%{python_sitelib}/glanceclient/ + # Delete tests rm -fr %{buildroot}%{python_sitelib}/tests @@ -64,6 +61,9 @@ rm -fr %{buildroot}%{python_sitelib}/tests %{python_sitelib}/*.egg-info %changelog +* Fri Nov 23 2012 Alan Pevec 1:0.6.0-1 +- Update to 0.6.0 + * Sat Sep 15 2012 Alan Pevec 1:0.5.1-1 - Update to 0.5.1 diff --git a/sources b/sources index b9f4d69..4c7fc97 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d5d2b1bce79ae32ee9d362fc7ccc0e32 python-glanceclient-0.5.1.tar.gz +c5da2d9b071513c4f9c64093afc33824 python-glanceclient-0.6.0.tar.gz