[python-glanceclient] Update to 0.5.1
Alan Pevec
apevec at fedoraproject.org
Sun Sep 23 09:54:53 UTC 2012
commit cc5fbf248a2b03b5c53d02817c20735dd2a596d6
Author: Alan Pevec <apevec at redhat.com>
Date: Sun Sep 23 11:48:19 2012 +0200
Update to 0.5.1
.gitignore | 1 +
...-v1-limit-query-parameter-works-correctly.patch | 61 -------------
...-ConnectionRefused-error-more-informative.patch | 91 +++++++++++++++++++
0002-Enable-client-V1-to-download-images.patch | 37 --------
0002-Fix-weird-None-displayed-on-some-errors.patch | 28 ++++++
0003-Typo-in-image-create-help-page.patch | 31 +++++++
0003-Update-pip-requires-with-warlock-2.patch | 23 -----
0004-Update-command-descriptions.patch | 94 --------------------
....patch => 0004-adjust-egg-info-for-Fedora.patch | 2 +-
python-glanceclient.spec | 22 +++--
sources | 2 +-
11 files changed, 166 insertions(+), 226 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2e12a60..291e6f1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/python-glanceclient-0.4.1.tar.gz
+/python-glanceclient-0.5.1.tar.gz
diff --git a/0001-Make-ConnectionRefused-error-more-informative.patch b/0001-Make-ConnectionRefused-error-more-informative.patch
new file mode 100644
index 0000000..d27871f
--- /dev/null
+++ b/0001-Make-ConnectionRefused-error-more-informative.patch
@@ -0,0 +1,91 @@
+From 8cee48b1ddf480d182bbc33ec684dcfd195b038c Mon Sep 17 00:00:00 2001
+From: Andrew Laski <andrew.laski at rackspace.com>
+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
new file mode 100644
index 0000000..0a7f92c
--- /dev/null
+++ b/0002-Fix-weird-None-displayed-on-some-errors.patch
@@ -0,0 +1,28 @@
+From 902bff79bbe52e831da947bb5ac5fce2330d810e Mon Sep 17 00:00:00 2001
+From: Vincent Untz <vuntz at suse.com>
+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/0003-Typo-in-image-create-help-page.patch b/0003-Typo-in-image-create-help-page.patch
new file mode 100644
index 0000000..9ca9450
--- /dev/null
+++ b/0003-Typo-in-image-create-help-page.patch
@@ -0,0 +1,31 @@
+From cdc94af297fe56341dfe0484d62f2e69d9aa5e9b Mon Sep 17 00:00:00 2001
+From: Stuart McLaren <stuart.mclaren at hp.com>
+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='<NAME>',
+ help='Name of image.')
+- at utils.arg('--disk-format', metavar='<CONTAINER_FORMAT>',
++ at utils.arg('--disk-format', metavar='<DISK_FORMAT>',
+ help='Disk format of image.')
+- at utils.arg('--container-format', metavar='<DISK_FORMAT>',
++ at utils.arg('--container-format', metavar='<CONTAINER_FORMAT>',
+ help='Container format of image.')
+ @utils.arg('--owner', metavar='<TENANT_ID>',
+ help='Tenant who should own image.')
diff --git a/0005-adjust-egg-info-for-Fedora.patch b/0004-adjust-egg-info-for-Fedora.patch
similarity index 89%
rename from 0005-adjust-egg-info-for-Fedora.patch
rename to 0004-adjust-egg-info-for-Fedora.patch
index 267cfe2..6a0e429 100644
--- a/0005-adjust-egg-info-for-Fedora.patch
+++ b/0004-adjust-egg-info-for-Fedora.patch
@@ -1,4 +1,4 @@
-From 6078d82488fdf503391767f910f36cf9661ffbbc Mon Sep 17 00:00:00 2001
+From b248b76d6c404578b625efc4b190161b12d9510e Mon Sep 17 00:00:00 2001
From: Alan Pevec <apevec at redhat.com>
Date: Thu, 23 Aug 2012 01:35:20 +0200
Subject: [PATCH] adjust egg info for Fedora
diff --git a/python-glanceclient.spec b/python-glanceclient.spec
index ae62401..f3923a3 100644
--- a/python-glanceclient.spec
+++ b/python-glanceclient.spec
@@ -3,23 +3,23 @@ Name: python-glanceclient
# and restarted version numbering from 0.1.1
# https://lists.launchpad.net/openstack/msg14248.html
Epoch: 1
-Version: 0.4.1
+Version: 0.5.1
Release: 1%{?dist}
Summary: Python API and CLI for OpenStack Glance
Group: Development/Languages
License: ASL 2.0
URL: http://github.com/openstack/python-glanceclient
-Source0: https://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz
+#Source0: https://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz
+Source0: http://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
#
-# patches_base=0.4.1
+# patches_base=0.5.1
#
-Patch0001: 0001-Ensure-v1-limit-query-parameter-works-correctly.patch
-Patch0002: 0002-Enable-client-V1-to-download-images.patch
-Patch0003: 0003-Update-pip-requires-with-warlock-2.patch
-Patch0004: 0004-Update-command-descriptions.patch
-Patch0005: 0005-adjust-egg-info-for-Fedora.patch
+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
BuildArch: noarch
BuildRequires: python-setuptools
@@ -37,11 +37,12 @@ glanceclient module), and a command-line script (glance). Each implements
%prep
%setup -q
+
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
-%patch0005 -p1
+
# Remove bundled egg-info
rm -rf python_glanceclient.egg-info
sed -i '/setuptools-git/d' setup.py
@@ -63,6 +64,9 @@ rm -fr %{buildroot}%{python_sitelib}/tests
%{python_sitelib}/*.egg-info
%changelog
+* Sat Sep 15 2012 Alan Pevec <apevec at redhat.com> 1:0.5.1-1
+- Update to 0.5.1
+
* Wed Aug 22 2012 Alan Pevec <apevec at redhat.com> 1:0.4.1-1
- Add dependency on python-setuptools (#850844)
- Revert client script rename, old glance client is now deprecated.
diff --git a/sources b/sources
index 0282528..b9f4d69 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c539cf7fb1a1337594004b44d8ccc451 python-glanceclient-0.4.1.tar.gz
+d5d2b1bce79ae32ee9d362fc7ccc0e32 python-glanceclient-0.5.1.tar.gz
More information about the scm-commits
mailing list