diff --git a/.gitignore b/.gitignore index 5faa659..7fb0a63 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /python-glanceclient-0.8.0.tar.gz /python-glanceclient-0.9.0.tar.gz +/python-glanceclient-0.10.0.tar.gz diff --git a/0001-Fix-problem-running-glance-version.patch b/0001-Fix-problem-running-glance-version.patch deleted file mode 100644 index e5e4bed..0000000 --- a/0001-Fix-problem-running-glance-version.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0c900e5fcd86c22b383b1fcecc911ce711af2f56 Mon Sep 17 00:00:00 2001 -From: Davanum Srinivas -Date: Fri, 5 Apr 2013 09:46:19 -0400 -Subject: [PATCH] Fix problem running glance --version - -__version__ should point to a string and not VersionInfo - -Fixes LP# 1164760 - -Change-Id: I27d366af5ed89d0931ef46eb1507e6ba0eec0b6e ---- - glanceclient/__init__.py | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/glanceclient/__init__.py b/glanceclient/__init__.py -index 06cc73d..514299a 100644 ---- a/glanceclient/__init__.py -+++ b/glanceclient/__init__.py -@@ -25,4 +25,11 @@ except ImportError: - - from glanceclient.openstack.common import version as common_version - --__version__ = common_version.VersionInfo('python-glanceclient') -+#__version__ = common_version.VersionInfo('python-glanceclient') -+ -+version_info = common_version.VersionInfo('python-glanceclient') -+ -+try: -+ __version__ = version_info.version_string() -+except AttributeError: -+ __version__ = None diff --git a/0001-Remove-runtime-dependency-on-python-pbr.patch b/0001-Remove-runtime-dependency-on-python-pbr.patch new file mode 100644 index 0000000..55c1fd9 --- /dev/null +++ b/0001-Remove-runtime-dependency-on-python-pbr.patch @@ -0,0 +1,26 @@ +From 8db13c161b7e1c37df97f14de6382602d5950d03 Mon Sep 17 00:00:00 2001 +From: Jakub Ruzicka +Date: Wed, 14 Aug 2013 16:07:03 +0200 +Subject: [PATCH] Remove runtime dependency on python-pbr. + +--- + glanceclient/__init__.py | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +diff --git a/glanceclient/__init__.py b/glanceclient/__init__.py +index 94dd4c9..b662bf9 100644 +--- a/glanceclient/__init__.py ++++ b/glanceclient/__init__.py +@@ -23,11 +23,4 @@ except ImportError: + import warnings + warnings.warn("Could not import glanceclient.client", ImportWarning) + +-import pbr.version +- +-version_info = pbr.version.VersionInfo('python-glanceclient') +- +-try: +- __version__ = version_info.version_string() +-except AttributeError: +- __version__ = None ++__version__ = "REDHATGLANCECLIENTVERSION" diff --git a/0002-Fix-glance-add-parsing-of-copy_from-option.patch b/0002-Fix-glance-add-parsing-of-copy_from-option.patch deleted file mode 100644 index 74ce06f..0000000 --- a/0002-Fix-glance-add-parsing-of-copy_from-option.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 93cc68cd128a20bf85e8d15b64104256e0d420cc Mon Sep 17 00:00:00 2001 -From: Jakub Ruzicka -Date: Thu, 11 Apr 2013 14:38:35 +0200 -Subject: [PATCH] Fix "glance add" parsing of "copy_from" option. - -copy_from was ignored which resulted in "glance add" attempting to read from -stdout. - -Fixes bug 1167899 - -Change-Id: I57fd85f7bb655bef69222d4fdf6b8274088ca827 ---- - glanceclient/v1/legacy_shell.py | 23 ++++++++--------------- - 1 file changed, 8 insertions(+), 15 deletions(-) - -diff --git a/glanceclient/v1/legacy_shell.py b/glanceclient/v1/legacy_shell.py -index 99a1813..5c43a99 100644 ---- a/glanceclient/v1/legacy_shell.py -+++ b/glanceclient/v1/legacy_shell.py -@@ -122,7 +122,7 @@ def do_add(gc, args): - } - - #NOTE(bcwaldon): Use certain properties only if they are explicitly set -- optional = ['id', 'name', 'disk_format', 'container_format', 'copy_from'] -+ optional = ['id', 'name', 'disk_format', 'container_format'] - for field in optional: - if field in fields: - image_meta[field] = fields.pop(field) -@@ -134,22 +134,15 @@ def do_add(gc, args): - print 'Found non-settable field %s. Removing.' % field - fields.pop(field) - -- def _external_source(fields, image_data): -- source = None -- if 'location' in fields.keys(): -- source = fields.pop('location') -- image_meta['location'] = source -- if 'checksum' in fields.keys(): -- image_meta['checksum'] = fields.pop('checksum') -- elif 'copy_from' in fields.keys(): -- source = fields.pop('copy_from') -- image_meta['copy_from'] = source -- return source -- - # We need either a location or image data/stream to add... -- location = _external_source(fields, image_meta) - image_data = None -- if not location: -+ if 'location' in fields.keys(): -+ image_meta['location'] = fields.pop('location') -+ if 'checksum' in fields.keys(): -+ image_meta['checksum'] = fields.pop('checksum') -+ elif 'copy_from' in fields.keys(): -+ image_meta['copy_from'] = fields.pop('copy_from') -+ else: - # Grab the image data stream from stdin or redirect, - # otherwise error out - image_data = sys.stdin diff --git a/0003-bug-1166263-image-update-handling-for-closed-stdin.patch b/0003-bug-1166263-image-update-handling-for-closed-stdin.patch deleted file mode 100644 index 261c1f4..0000000 --- a/0003-bug-1166263-image-update-handling-for-closed-stdin.patch +++ /dev/null @@ -1,54 +0,0 @@ -From b76382c1687497c03951fbfe8fa326df7805a851 Mon Sep 17 00:00:00 2001 -From: MattieuPuel -Date: Sun, 14 Apr 2013 20:39:19 +0200 -Subject: [PATCH] bug 1166263 image-update handling for closed stdin - -handles the case where an image-update command is issued from a cron job with an -invalid standard input file descriptor: consider no image data is provided when -no --file option present. - -Change-Id: I5eb3433311e5faf0a3fb7eb36f6a01e5df7efe4c ---- - glanceclient/v1/shell.py | 25 ++++++++++++++++--------- - 1 file changed, 16 insertions(+), 9 deletions(-) - -diff --git a/glanceclient/v1/shell.py b/glanceclient/v1/shell.py -index 5ef6cfa..a1283b3 100644 ---- a/glanceclient/v1/shell.py -+++ b/glanceclient/v1/shell.py -@@ -113,19 +113,26 @@ def _set_data_field(fields, args): - if args.file: - fields['data'] = open(args.file, 'rb') - else: -- # We distinguish between cases where image data is pipelined: -- # (1) glance ... < /tmp/file or cat /tmp/file | glance ... -- # and cases where no image data is provided: -- # (2) glance ... -- if (sys.stdin.isatty() is not True): -- # Our input is from stdin, and we are part of -- # a pipeline, so data may be present. (We are of -- # type (1) above.) -+ # distinguish cases where: -+ # (1) stdin is not valid (as in cron jobs): -+ # glance ... <&- -+ # (2) image data is provided through standard input: -+ # glance ... < /tmp/file or cat /tmp/file | glance ... -+ # (3) no image data provided: -+ # glance ... -+ try: -+ os.fstat(0) -+ except OSError: -+ # (1) stdin is not valid (closed...) -+ fields['data'] = None -+ return -+ if not sys.stdin.isatty(): -+ # (2) image data is provided through standard input - if msvcrt: - msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) - fields['data'] = sys.stdin - else: -- # We are of type (2) above, no image data supplied -+ # (3) no image data provided - fields['data'] = None - - diff --git a/python-glanceclient.spec b/python-glanceclient.spec index 18d07a5..6b193e8 100644 --- a/python-glanceclient.spec +++ b/python-glanceclient.spec @@ -1,7 +1,7 @@ Name: python-glanceclient Epoch: 1 -Version: 0.9.0 -Release: 3%{?dist} +Version: 0.10.0 +Release: 1%{?dist} Summary: Python API and CLI for OpenStack Glance Group: Development/Languages @@ -10,17 +10,18 @@ URL: http://github.com/openstack/python-glanceclient Source0: https://pypi.python.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz # -# patches_base=0.9.0 +# patches_base=0.10.0 # -Patch0001: 0001-Fix-problem-running-glance-version.patch -Patch0002: 0002-Fix-glance-add-parsing-of-copy_from-option.patch -Patch0003: 0003-bug-1166263-image-update-handling-for-closed-stdin.patch +Patch0001: 0001-Remove-runtime-dependency-on-python-pbr.patch BuildArch: noarch +BuildRequires: python2-devel BuildRequires: python-setuptools +BuildRequires: python-d2to1 +BuildRequires: python-pbr Requires: python-httplib2 -Requires: python-keystoneclient >= 1:0.1.2 +Requires: python-keystoneclient Requires: python-prettytable Requires: python-setuptools Requires: python-warlock @@ -31,17 +32,34 @@ This is a client for the OpenStack Glance API. There's a Python API (the glanceclient module), and a command-line script (glance). Each implements 100% of the OpenStack Glance API. + +%package doc +Summary: Documentation for OpenStack Nova API Client +Group: Documentation + +BuildRequires: python-sphinx + +%description doc +This is a client for the OpenStack Glance API. There's a Python API (the +glanceclient module), and a command-line script (glance). Each implements +100% of the OpenStack Glance API. + +This package contains auto-generated documentation. + + %prep %setup -q %patch0001 -p1 -%patch0002 -p1 -%patch0003 -p1 + +# We provide version like this in order to remove runtime dep on pbr. +sed -i s/REDHATGLANCECLIENTVERSION/%{version}/ glanceclient/__init__.py # Remove bundled egg-info rm -rf python_glanceclient.egg-info # let RPM handle deps sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py +rm -rf {,test-}requirements.txt %build %{__python} setup.py build @@ -49,11 +67,14 @@ sed -i '/setup_requires/d; /install_requires/d; /dependency_links/d' setup.py %install %{__python} setup.py install -O1 --skip-build --root %{buildroot} -# generate versioninfo -echo "%{version}" > %{buildroot}%{python_sitelib}/glanceclient/versioninfo +export PYTHONPATH="$( pwd ):$PYTHONPATH" +sphinx-build -b html doc/source html + +# For some reason, openstack-glance is providing (obsoloete) glance manpage. +# Enable this once https://bugs.launchpad.net/glance/+bug/1212300 is fixed. +#sphinx-build -b man doc/source man +#install -p -D -m 644 man/glance.1 %{buildroot}%{_mandir}/man1/glance.1 -# Delete tests -rm -fr %{buildroot}%{python_sitelib}/tests %files %doc README.rst @@ -61,8 +82,20 @@ rm -fr %{buildroot}%{python_sitelib}/tests %{_bindir}/glance %{python_sitelib}/glanceclient %{python_sitelib}/*.egg-info +#%{_mandir}/man1/glance.1.gz + +%files doc +%doc html + %changelog +* Wed Aug 14 2013 Jakub Ruzicka - 1:0.10.0-1 +- Update to upstream 0.10.0. +- Remove runtime dependency on python-pbr. +- Add doc package. +- New BuildRequires: python2-devel, python-d2to1, python-pbr +- Remove python-keystoneclient version cap. + * Sun Aug 04 2013 Fedora Release Engineering - 1:0.9.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild diff --git a/sources b/sources index 1203107..8ce2d07 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4cd8a42fe99bb46124354fa362234343 python-glanceclient-0.9.0.tar.gz +93702227dfb0c839d6d0877d6ad6f95c python-glanceclient-0.10.0.tar.gz