[python-glanceclient/f18] Update to 0.8.0 pypi sources.

Jakub Ruzicka jruzicka at fedoraproject.org
Mon Mar 11 17:10:41 UTC 2013


commit 8f7f7bad4df2520a418259c64638dd82bdbfebaf
Author: Jakub Ruzicka <jruzicka at redhat.com>
Date:   Mon Mar 11 08:41:41 2013 -0700

    Update to 0.8.0 pypi sources.
    
    Use 0.8.0 pypi tarball with patches from stable/folsom branch.

 .gitignore                                         |    3 +-
 ...-ConnectionRefused-error-more-informative.patch |   91 --------------------
 0001-Report-name-resolution-errors-properly.patch  |   88 +++++++++++++++++++
 0002-Fix-weird-None-displayed-on-some-errors.patch |   28 ------
 ...-Replace-SchemaNotFound-with-HTTPNotFound.patch |   25 ++++++
 0003-Typo-in-image-create-help-page.patch          |   31 -------
 0003-Use-getattr-properly-in-legacy-shell.patch    |   28 ++++++
 0004-adjust-egg-info-for-Fedora.patch              |   22 -----
 python-glanceclient.spec                           |   25 +++---
 sources                                            |    2 +-
 10 files changed, 155 insertions(+), 188 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 291e6f1..19530ab 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.8.0.tar.gz
diff --git a/0001-Report-name-resolution-errors-properly.patch b/0001-Report-name-resolution-errors-properly.patch
new file mode 100644
index 0000000..25c34d3
--- /dev/null
+++ b/0001-Report-name-resolution-errors-properly.patch
@@ -0,0 +1,88 @@
+From 0fce5e31dfba299018e5efd0ec7e263ef48bf271 Mon Sep 17 00:00:00 2001
+From: Stanislaw Pitucha <stanislaw.pitucha at hp.com>
+Date: Tue, 19 Feb 2013 15:40:16 +0000
+Subject: [PATCH] Report name resolution errors properly
+
+Errors in name resolution have been logged previously with the url path
+rather than the hostname. That resulted in incorrect errors like:
+
+InvalidEndpoint: Error finding address for
+/v1/images/detail?is_public=none&limit=20: [Errno -2]
+Name or service not known
+
+rather than one mentioning hostname itself. This patch changes the log
+message to fit the situation.
+
+Change-Id: I1eecbcb22d41b1341c214937b9cbfd046fd301a0
+---
+ glanceclient/common/http.py |  3 ++-
+ tests/test_http.py          | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 44 insertions(+), 1 deletion(-)
+
+diff --git a/glanceclient/common/http.py b/glanceclient/common/http.py
+index 115204f..7146ace 100644
+--- a/glanceclient/common/http.py
++++ b/glanceclient/common/http.py
+@@ -183,7 +183,8 @@ class HTTPClient(object):
+                 conn.request(method, conn_url, **kwargs)
+             resp = conn.getresponse()
+         except socket.gaierror as e:
+-            message = "Error finding address for %(url)s: %(e)s" % locals()
++            message = "Error finding address for %s: %s" % (
++                self.endpoint_hostname, e)
+             raise exc.InvalidEndpoint(message=message)
+         except (socket.error, socket.timeout) as e:
+             endpoint = self.endpoint
+diff --git a/tests/test_http.py b/tests/test_http.py
+index cabcf8d..3d87444 100644
+--- a/tests/test_http.py
++++ b/tests/test_http.py
+@@ -83,6 +83,48 @@ class TestClient(testtools.TestCase):
+         self.assertEqual(resp, fake)
+ 
+ 
++class TestHostResolutionError(testtools.TestCase):
++
++    def setUp(self):
++        super(TestHostResolutionError, self).setUp()
++        self.mock = mox.Mox()
++        self.invalid_host = "example.com.incorrect_top_level_domain"
++
++    def test_incorrect_domain_error(self):
++        """
++        Make sure that using a domain which does not resolve causes an
++        exception which mentions that specific hostname as a reason for
++        failure.
++        """
++        class FailingConnectionClass(object):
++            def __init__(self, *args, **kwargs):
++                pass
++
++            def putrequest(self, *args, **kwargs):
++                raise socket.gaierror(-2, "Name or service not known")
++
++            def request(self, *args, **kwargs):
++                raise socket.gaierror(-2, "Name or service not known")
++
++        self.endpoint = 'http://%s:9292' % (self.invalid_host,)
++        self.client = http.HTTPClient(self.endpoint, token=u'abc123')
++
++        self.mock.StubOutWithMock(self.client, 'get_connection')
++        self.client.get_connection().AndReturn(FailingConnectionClass())
++        self.mock.ReplayAll()
++
++        try:
++            self.client.raw_request('GET', '/example/path')
++            self.fail("gaierror should be raised")
++        except exc.InvalidEndpoint as e:
++            self.assertTrue(self.invalid_host in str(e),
++                            "exception should contain the hostname")
++
++    def tearDown(self):
++        super(TestHostResolutionError, self).tearDown()
++        self.mock.UnsetStubs()
++
++
+ class TestResponseBodyIterator(testtools.TestCase):
+     def test_iter_default_chunk_size_64k(self):
+         resp = utils.FakeResponse({}, StringIO.StringIO('X' * 98304))
diff --git a/0002-Replace-SchemaNotFound-with-HTTPNotFound.patch b/0002-Replace-SchemaNotFound-with-HTTPNotFound.patch
new file mode 100644
index 0000000..a7d45a8
--- /dev/null
+++ b/0002-Replace-SchemaNotFound-with-HTTPNotFound.patch
@@ -0,0 +1,25 @@
+From 61fd49f43724a46040702c7a5627da2f823bb8ea Mon Sep 17 00:00:00 2001
+From: Brian Waldon <bcwaldon at gmail.com>
+Date: Fri, 22 Feb 2013 10:21:00 -0800
+Subject: [PATCH] Replace SchemaNotFound with HTTPNotFound
+
+Fixes bug 1131682
+
+Change-Id: I615acbef0411677cae5d30262702babd900c0c81
+---
+ glanceclient/v2/shell.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/glanceclient/v2/shell.py b/glanceclient/v2/shell.py
+index cb45770..12bef8c 100644
+--- a/glanceclient/v2/shell.py
++++ b/glanceclient/v2/shell.py
+@@ -43,7 +43,7 @@ def do_explain(gc, args):
+     """Describe a specific model."""
+     try:
+         schema = gc.schemas.get(args.model)
+-    except exc.SchemaNotFound:
++    except exc.HTTPNotFound:
+         utils.exit('Unable to find requested model \'%s\'' % args.model)
+     else:
+         formatters = {'Attribute': lambda m: m.name}
diff --git a/0003-Use-getattr-properly-in-legacy-shell.patch b/0003-Use-getattr-properly-in-legacy-shell.patch
new file mode 100644
index 0000000..c1abaab
--- /dev/null
+++ b/0003-Use-getattr-properly-in-legacy-shell.patch
@@ -0,0 +1,28 @@
+From 6df2f8c8405096528e4ded264bc38bd6ef17a7a5 Mon Sep 17 00:00:00 2001
+From: Brian Waldon <bcwaldon at gmail.com>
+Date: Fri, 22 Feb 2013 10:15:50 -0800
+Subject: [PATCH] Use getattr properly in legacy shell
+
+Fixes bug 1131703
+
+Change-Id: If97f422af170c29785d2bf8884fafff979031e14
+---
+ glanceclient/v1/legacy_shell.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/glanceclient/v1/legacy_shell.py b/glanceclient/v1/legacy_shell.py
+index 56bce65..99a1813 100644
+--- a/glanceclient/v1/legacy_shell.py
++++ b/glanceclient/v1/legacy_shell.py
+@@ -266,8 +266,9 @@ def _get_images(gc, args):
+ 
+     optional_kwargs = ['marker', 'sort_key', 'sort_dir']
+     for kwarg in optional_kwargs:
+-        if getattr(args, kwarg):
+-            parameters[kwarg] = getattr(args.kwarg)
++        value = getattr(args, kwarg, None)
++        if value is not None:
++            parameters[kwarg] = value
+ 
+     return gc.images.list(**parameters)
+ 
diff --git a/python-glanceclient.spec b/python-glanceclient.spec
index f3923a3..b9d38f6 100644
--- a/python-glanceclient.spec
+++ b/python-glanceclient.spec
@@ -1,25 +1,20 @@
 Name:             python-glanceclient
-# Since folsom-2 OpenStack clients follow their own release plan
-# and restarted version numbering from 0.1.1
-# https://lists.launchpad.net/openstack/msg14248.html
 Epoch:            1
-Version:          0.5.1
+Version:          0.8.0
 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:          http://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz
+Source0:          https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz
 
 #
-# patches_base=0.5.1
+# patches_base=0.8.0+1
 #
-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-Report-name-resolution-errors-properly.patch
+Patch0002: 0002-Replace-SchemaNotFound-with-HTTPNotFound.patch
+Patch0003: 0003-Use-getattr-properly-in-legacy-shell.patch
 
 BuildArch:        noarch
 BuildRequires:    python-setuptools
@@ -41,11 +36,11 @@ glanceclient module), and a command-line script (glance). Each implements
 %patch0001 -p1
 %patch0002 -p1
 %patch0003 -p1
-%patch0004 -p1
 
 # Remove bundled egg-info
 rm -rf python_glanceclient.egg-info
-sed -i '/setuptools-git/d' setup.py
+# let RPM handle deps
+sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py
 
 %build
 %{__python} setup.py build
@@ -64,6 +59,10 @@ rm -fr %{buildroot}%{python_sitelib}/tests
 %{python_sitelib}/*.egg-info
 
 %changelog
+* Mon Mar 11 2013 Jakub Ruzicka <jruzicka at redhat.com> - 
+- Update to 0.8.0.
+- Switch from tarballs.openstack.org to pypi sources.
+
 * Sat Sep 15 2012 Alan Pevec <apevec at redhat.com> 1:0.5.1-1
 - Update to 0.5.1
 
diff --git a/sources b/sources
index b9f4d69..8a33fd1 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-d5d2b1bce79ae32ee9d362fc7ccc0e32  python-glanceclient-0.5.1.tar.gz
+cb7b84fb42d1023cd97d29d46cec7145  python-glanceclient-0.8.0.tar.gz


More information about the scm-commits mailing list