[python-glanceclient] New upstream release 0.4.1
Alan Pevec
apevec at fedoraproject.org
Thu Aug 23 00:03:42 UTC 2012
commit b450cf15b787c2441bf6a5c339a0db8b820cc177
Author: Alan Pevec <apevec at redhat.com>
Date: Thu Aug 23 00:23:22 2012 +0200
New upstream release 0.4.1
Add dependency on python-setuptools (#850844)
Revert client script rename, old glance client is now deprecated
.gitignore | 2 +-
...-v1-limit-query-parameter-works-correctly.patch | 61 +++++++++++++
0002-Enable-client-V1-to-download-images.patch | 37 ++++++++
0003-Update-pip-requires-with-warlock-2.patch | 23 +++++
0004-Update-command-descriptions.patch | 94 ++++++++++++++++++++
0005-adjust-egg-info-for-Fedora.patch | 22 +++++
...eclient-remove-argparse-from-egg-requires.patch | 11 ---
python-glanceclient.spec | 42 ++++++---
sources | 2 +-
9 files changed, 268 insertions(+), 26 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 9fd67d7..2e12a60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/python-glanceclient-2012.2~f1.tar.gz
+/python-glanceclient-0.4.1.tar.gz
diff --git a/0001-Ensure-v1-limit-query-parameter-works-correctly.patch b/0001-Ensure-v1-limit-query-parameter-works-correctly.patch
new file mode 100644
index 0000000..3cb6a8c
--- /dev/null
+++ b/0001-Ensure-v1-limit-query-parameter-works-correctly.patch
@@ -0,0 +1,61 @@
+From d64876424e87b3a7f76a9bf4d29fdacbc5ad4bc4 Mon Sep 17 00:00:00 2001
+From: Brian Lamar <brian.lamar at rackspace.com>
+Date: Wed, 15 Aug 2012 14:39:39 -0400
+Subject: [PATCH] Ensure v1 'limit' query parameter works correctly.
+
+The tests were present but were not asserting list results.
+
+page_size was overriding the absolute limit so limits were
+not working if they were less than the page_size.
+
+Fixes bug 1037233
+
+Change-Id: If102824212e3846bc65d3f7928cf7aa2e48aaa63
+---
+ glanceclient/v1/images.py | 6 ++++--
+ tests/v1/test_images.py | 5 +++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/glanceclient/v1/images.py b/glanceclient/v1/images.py
+index a4b759a..b41b314 100644
+--- a/glanceclient/v1/images.py
++++ b/glanceclient/v1/images.py
+@@ -123,18 +123,20 @@ class ImageManager(base.Manager):
+ structure of an image object
+ :rtype: list of :class:`Image`
+ """
+- limit = kwargs.get('limit')
++ absolute_limit = kwargs.get('limit')
+
+ def paginate(qp, seen=0):
+ url = '/v1/images/detail?%s' % urllib.urlencode(qp)
+ images = self._list(url, "images")
+ for image in images:
+ seen += 1
++ if absolute_limit is not None and seen > absolute_limit:
++ return
+ yield image
+
+ page_size = qp.get('limit')
+ if (page_size and len(images) == page_size and
+- (limit is None or 0 < seen < limit)):
++ (absolute_limit is None or 0 < seen < absolute_limit)):
+ qp['marker'] = image.id
+ for image in paginate(qp, seen):
+ yield image
+diff --git a/tests/v1/test_images.py b/tests/v1/test_images.py
+index 6f258e6..759010f 100644
+--- a/tests/v1/test_images.py
++++ b/tests/v1/test_images.py
+@@ -223,8 +223,9 @@ class ImageManagerTest(unittest.TestCase):
+ self.assertEqual(images[2].id, 'c')
+
+ def test_list_with_limit_less_than_page_size(self):
+- list(self.mgr.list(page_size=20, limit=10))
+- expect = [('GET', '/v1/images/detail?limit=20', {}, None)]
++ results = list(self.mgr.list(page_size=2, limit=1))
++ expect = [('GET', '/v1/images/detail?limit=2', {}, None)]
++ self.assertEqual(1, len(results))
+ self.assertEqual(self.api.calls, expect)
+
+ def test_list_with_limit_greater_than_page_size(self):
diff --git a/0002-Enable-client-V1-to-download-images.patch b/0002-Enable-client-V1-to-download-images.patch
new file mode 100644
index 0000000..52e3c6b
--- /dev/null
+++ b/0002-Enable-client-V1-to-download-images.patch
@@ -0,0 +1,37 @@
+From 77c8e3f023daec1cabf07eeaeb55c3a45af311a1 Mon Sep 17 00:00:00 2001
+From: Lars Gellrich <lars.gellrich at hp.com>
+Date: Mon, 13 Aug 2012 09:21:58 +0000
+Subject: [PATCH] Enable client V1 to download images
+
+Added the CLI option image-download to download an image via API V1.
+Based on commit 137b3cf975d73437943e100065c76b83acfa7dd3
+
+Related to bp glance-client-v2
+
+Change-Id: Ie587e208ad7433e468798cd9b1846b4a21e1c4ec
+---
+ glanceclient/v1/shell.py | 11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py
+index c521ea2..e131a08 100644
+--- a/glanceclient/v1/shell.py
++++ b/glanceclient/v1/shell.py
+@@ -77,6 +77,17 @@ def do_image_show(gc, args):
+ _image_show(image)
+
+
++ at utils.arg('--file', metavar='<FILE>',
++ help='Local file to save downloaded image data to. '
++ 'If this is not specified the image data will be '
++ 'written to stdout.')
++ at utils.arg('id', metavar='<IMAGE_ID>', help='ID of image to download.')
++def do_image_download(gc, args):
++ """Download a specific image."""
++ body = gc.images.data(args.id)
++ utils.save_image(body, args.file)
++
++
+ @utils.arg('--id', metavar='<IMAGE_ID>',
+ help='ID of image to reserve.')
+ @utils.arg('--name', metavar='<NAME>',
diff --git a/0003-Update-pip-requires-with-warlock-2.patch b/0003-Update-pip-requires-with-warlock-2.patch
new file mode 100644
index 0000000..4c1054e
--- /dev/null
+++ b/0003-Update-pip-requires-with-warlock-2.patch
@@ -0,0 +1,23 @@
+From 5e6638d9c32a223c2e9be4190de78f5afee65cdc Mon Sep 17 00:00:00 2001
+From: Dan Prince <dprince at redhat.com>
+Date: Fri, 17 Aug 2012 11:50:33 -0400
+Subject: [PATCH] Update pip-requires with warlock<2.
+
+Allow warlock to be used up to version 2 (the next
+major version of the library).
+
+Change-Id: I0c5a47f9ebfa0145dfab7310a22982d5d8e9aa52
+---
+ tools/pip-requires | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/tools/pip-requires b/tools/pip-requires
+index a1f3536..bbb4edf 100644
+--- a/tools/pip-requires
++++ b/tools/pip-requires
+@@ -1,4 +1,4 @@
+ argparse
+ prettytable>=0.6,<0.7
+ python-keystoneclient>=0.1.2,<0.2
+-warlock==0.1.0
++warlock<2
diff --git a/0004-Update-command-descriptions.patch b/0004-Update-command-descriptions.patch
new file mode 100644
index 0000000..b45c3c0
--- /dev/null
+++ b/0004-Update-command-descriptions.patch
@@ -0,0 +1,94 @@
+From 012efff130e1d8c6a9672df3c2c616a405acea0d Mon Sep 17 00:00:00 2001
+From: Brian Waldon <bcwaldon at gmail.com>
+Date: Tue, 21 Aug 2012 13:07:08 -0700
+Subject: [PATCH] Update command descriptions
+
+Several commands did not have descriptions or the descriptions
+they had were insufficient. This adds mission descriptions
+and fattens up those that were too lean.
+
+Change-Id: I091ae70cdae5d3f72f273519d88873cb5392ba3b
+---
+ glanceclient/v1/legacy_shell.py | 1 +
+ glanceclient/v1/shell.py | 7 ++++++-
+ glanceclient/v2/shell.py | 2 +-
+ 3 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/glanceclient/v1/legacy_shell.py b/glanceclient/v1/legacy_shell.py
+index 030cee4..b6f3903 100644
+--- a/glanceclient/v1/legacy_shell.py
++++ b/glanceclient/v1/legacy_shell.py
+@@ -249,6 +249,7 @@ def do_delete(gc, args):
+
+ @utils.arg('id', metavar='<IMAGE_ID>', help='ID of image to describe.')
+ def do_show(gc, args):
++ """DEPRECATED! Use image-show instead."""
+ image = gc.images.get(args.id)
+ print_image_formatted(gc, image)
+ return SUCCESS
+diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py
+index e131a08..3646f9f 100644
+--- a/glanceclient/v1/shell.py
++++ b/glanceclient/v1/shell.py
+@@ -42,7 +42,7 @@ from glanceclient.v1.legacy_shell import *
+ @utils.arg('--page-size', metavar='<SIZE>', default=None, type=int,
+ help='Number of images to request in each paginated request.')
+ def do_image_list(gc, args):
+- """List images."""
++ """List images you can access."""
+ filter_keys = ['name', 'status', 'container_format', 'disk_format',
+ 'size_min', 'size_max']
+ filter_items = [(key, getattr(args, key)) for key in filter_keys]
+@@ -132,6 +132,7 @@ def do_image_download(gc, args):
+ help=("Arbitrary property to associate with image. "
+ "May be used multiple times."))
+ def do_image_create(gc, args):
++ """Create a new image."""
+ # Filter out None values
+ fields = dict(filter(lambda x: x[1] is not None, vars(args).items()))
+
+@@ -202,6 +203,7 @@ def do_image_create(gc, args):
+ "not explicitly set in the update request. Otherwise, "
+ "those properties not referenced are preserved."))
+ def do_image_update(gc, args):
++ """Update a specific image."""
+ # Filter out None values
+ fields = dict(filter(lambda x: x[1] is not None, vars(args).items()))
+
+@@ -241,6 +243,7 @@ def do_image_delete(gc, args):
+ @utils.arg('--tenant-id', metavar='<TENANT_ID>',
+ help='Filter results by a tenant ID.')
+ def do_member_list(gc, args):
++ """Describe sharing permissions by image or tenant."""
+ if args.image_id and args.tenant_id:
+ print 'Unable to filter members by both --image-id and --tenant-id.'
+ sys.exit(1)
+@@ -264,6 +267,7 @@ def do_member_list(gc, args):
+ @utils.arg('--can-share', action='store_true', default=False,
+ help='Allow the specified tenant to share this image.')
+ def do_member_create(gc, args):
++ """Share a specific image with a tenant."""
+ gc.image_members.create(args.image_id, args.tenant_id, args.can_share)
+
+
+@@ -272,6 +276,7 @@ def do_member_create(gc, args):
+ @utils.arg('tenant_id', metavar='<TENANT_ID>',
+ help='Tenant to add as member')
+ def do_member_delete(gc, args):
++ """Remove a shared image from a tenant."""
+ if not options.dry_run:
+ gc.image_members.delete(args.image_id, args.tenant_id)
+ else:
+diff --git a/glanceclient/v2/shell.py b/glanceclient/v2/shell.py
+index 63bcd13..4ed2f32 100644
+--- a/glanceclient/v2/shell.py
++++ b/glanceclient/v2/shell.py
+@@ -20,7 +20,7 @@ from glanceclient import exc
+ @utils.arg('--page-size', metavar='<SIZE>', default=None, type=int,
+ help='Number of images to request in each paginated request.')
+ def do_image_list(gc, args):
+- """List images."""
++ """List images you can access."""
+ kwargs = {}
+ if args.page_size is not None:
+ kwargs['page_size'] = args.page_size
diff --git a/0005-adjust-egg-info-for-Fedora.patch b/0005-adjust-egg-info-for-Fedora.patch
new file mode 100644
index 0000000..267cfe2
--- /dev/null
+++ b/0005-adjust-egg-info-for-Fedora.patch
@@ -0,0 +1,22 @@
+From 6078d82488fdf503391767f910f36cf9661ffbbc 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
+
+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 e2365a7..e1aba5e 100644
--- a/python-glanceclient.spec
+++ b/python-glanceclient.spec
@@ -1,24 +1,34 @@
Name: python-glanceclient
-Version: 2012.2
-Release: 0.3.f1%{?dist}
+# 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.4.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: http://launchpad.net/glance/folsom/folsom-1/+download/python-glanceclient-2012.2~f1.tar.gz
+Source0: https://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz
-Patch0: glanceclient-remove-argparse-from-egg-requires.patch
+#
+# patches_base=0.4.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
BuildArch: noarch
BuildRequires: python-setuptools
-Requires: python-argparse
Requires: python-httplib2
-Requires: python-prettytable
Requires: python-keystoneclient
-
-Conflicts: openstack-glance < 2012.2
+Requires: python-prettytable
+Requires: python-setuptools
+Requires: python-warlock
%description
This is a client for the OpenStack Glance API. There's a Python API (the
@@ -27,16 +37,17 @@ glanceclient module), and a command-line script (glance). Each implements
%prep
%setup -q
-%patch0 -p1
+%patch0001 -p1
+%patch0002 -p1
+%patch0003 -p1
+%patch0004 -p1
+%patch0005 -p1
%build
%{__python} setup.py build
%install
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
-# rename client script to avoid conflict with old glance client
-# from openstack-glance RPM
-mv %{buildroot}%{_bindir}/glance %{buildroot}%{_bindir}/glance-client
# Delete tests
rm -fr %{buildroot}%{python_sitelib}/tests
@@ -44,11 +55,16 @@ rm -fr %{buildroot}%{python_sitelib}/tests
%files
%doc README.rst
%doc LICENSE
-%{_bindir}/glance-client
+%{_bindir}/glance
%{python_sitelib}/glanceclient
%{python_sitelib}/*.egg-info
%changelog
+* 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.
+- New upstream release.
+
* Fri Aug 03 2012 Alan Pevec <apevec at redhat.com> 2012.2-0.3.f1
- rename client script to avoid conflict with old glance client
diff --git a/sources b/sources
index 8da2f20..0282528 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-63d3ab81fb7e249ee906eb3fec9aa4a6 python-glanceclient-2012.2~f1.tar.gz
+c539cf7fb1a1337594004b44d8ccc451 python-glanceclient-0.4.1.tar.gz
More information about the scm-commits
mailing list