From b79d3a52df1d08f6bec7db7428e8d149adba25cf Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Wed, 25 Nov 2009 23:31:52 +0000 Subject: [PATCH 1/8] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3e5f230..7240e95 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: python-boto -# $Id$ +# $Id: Makefile,v 1.1 2007/08/31 01:21:00 petersen Exp $ NAME := python-boto SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 3bb620c62deedb953766b3908bb01533421cb250 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sat, 9 Jan 2010 21:48:10 +0000 Subject: [PATCH 2/8] Upgrade to 1.9b --- .cvsignore | 2 +- python-boto.spec | 17 ++++++++++++----- sources | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.cvsignore b/.cvsignore index 9ccf292..94ed4e3 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -boto-1.8d.tar.gz +boto-1.9b.tar.gz diff --git a/python-boto.spec b/python-boto.spec index 32d7a7e..84af98c 100644 --- a/python-boto.spec +++ b/python-boto.spec @@ -3,7 +3,7 @@ Summary: A simple lightweight interface to Amazon Web Services Name: python-boto -Version: 1.8d +Version: 1.9b Release: 1%{?dist} License: MIT Group: Development/Languages @@ -30,18 +30,25 @@ use, lightweight wrapper around the Amazon services. rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT -# Remove all test scripts -rm -rf $RPM_BUILD_ROOT{%{_bindir},%{python_sitelib}/tests} - %clean rm -rf $RPM_BUILD_ROOT %files -%defattr(-,root,root) +%defattr(-,root,root,-) %doc README +%{_bindir}/elbadmin +%{_bindir}/fetch_file +%{_bindir}/launch_instance +%{_bindir}/list_instances +%{_bindir}/s3put +%{_bindir}/sdbadmin +%{_bindir}/taskadmin %{python_sitelib}/* %changelog +* Sat Jan 09 2010 Robert Scheck 1.9b-1 +- Upgrade to 1.9b + * Fri Jul 24 2009 Robert Scheck 1.8d-1 - Upgrade to 1.8d (#513560) diff --git a/sources b/sources index 622a7e2..15ceac8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3de4ac64015a9b06960fd14827a9c07a boto-1.8d.tar.gz +4fc2fd7b70a971b1363f8465aafe7091 boto-1.9b.tar.gz From 42551d7ba1bf5dd6f87246b89baad67ce8ef8e07 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Tue, 9 Feb 2010 00:42:54 +0000 Subject: [PATCH 3/8] Backported upstream patch for image registration (#561216) --- python-boto-1.9b-image.patch | 42 ++++++++++++++++++++++++++++++++++++ python-boto.spec | 7 +++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 python-boto-1.9b-image.patch diff --git a/python-boto-1.9b-image.patch b/python-boto-1.9b-image.patch new file mode 100644 index 0000000..1c93a77 --- /dev/null +++ b/python-boto-1.9b-image.patch @@ -0,0 +1,42 @@ +Don't require Name param on RegisterImage (even though EC2 docs say it is required) +and change Image to ImageLocation. Fixes issue 323: + + - http://code.google.com/p/boto/issues/detail?id=323 + - http://code.google.com/p/boto/source/detail?r=1448 + +--- boto-1.9b/boto/ec2/connection.py 2009-12-21 14:59:03.000000000 +0100 ++++ boto-1.9b/boto/ec2/connection.py.image 2010-02-09 01:36:11.000000000 +0100 +@@ -176,11 +176,11 @@ + except IndexError: # None of those images available + return None + +- def register_image(self, name, description=None, image_location=None, ++ def register_image(self, name=None, description=None, image_location=None, + architecture=None, kernel_id=None, ramdisk_id=None, + root_device_name=None, block_device_map=None): + """ +- Register an image. ++ Register an image. Valid only for EBS-based images. + + :type name: string + :param name: The name of the AMI. +@@ -210,7 +210,9 @@ + :rtype: string + :return: The new image id + """ +- params = {'Name': name} ++ params = {} ++ if name: ++ params['Name'] = name + if description: + params['Description'] = description + if architecture: +@@ -220,7 +222,7 @@ + if ramdisk_id: + params['RamdiskId'] = ramdisk_id + if image_location: +- params['Location'] = image_location ++ params['ImageLocation'] = image_location + if root_device_name: + params['RootDeviceName'] = root_device_name + if block_device_map: diff --git a/python-boto.spec b/python-boto.spec index 84af98c..b5c8675 100644 --- a/python-boto.spec +++ b/python-boto.spec @@ -4,11 +4,12 @@ Summary: A simple lightweight interface to Amazon Web Services Name: python-boto Version: 1.9b -Release: 1%{?dist} +Release: 2%{?dist} License: MIT Group: Development/Languages URL: http://code.google.com/p/%{pkgname}/ Source: http://boto.googlecode.com/files/%{pkgname}-%{version}.tar.gz +Patch0: python-boto-1.9b-image.patch BuildRequires: python-devel, python-setuptools-devel BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -22,6 +23,7 @@ use, lightweight wrapper around the Amazon services. %prep %setup -q -n %{pkgname}-%{version} +%patch0 -p1 -b .image %build %{__python} setup.py build @@ -46,6 +48,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/* %changelog +* Tue Feb 09 2010 Robert Scheck 1.9b-2 +- Backported upstream patch for image registration (#561216) + * Sat Jan 09 2010 Robert Scheck 1.9b-1 - Upgrade to 1.9b From 6d480aa2186f09a88c8a334ddbef23990304ceac Mon Sep 17 00:00:00 2001 From: dmalcolm Date: Thu, 22 Jul 2010 03:53:51 +0000 Subject: [PATCH 4/8] - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild --- python-boto.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-boto.spec b/python-boto.spec index b5c8675..0aae22e 100644 --- a/python-boto.spec +++ b/python-boto.spec @@ -4,7 +4,7 @@ Summary: A simple lightweight interface to Amazon Web Services Name: python-boto Version: 1.9b -Release: 2%{?dist} +Release: 3%{?dist} License: MIT Group: Development/Languages URL: http://code.google.com/p/%{pkgname}/ @@ -48,6 +48,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/* %changelog +* Wed Jul 21 2010 David Malcolm - 1.9b-3 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + * Tue Feb 09 2010 Robert Scheck 1.9b-2 - Backported upstream patch for image registration (#561216) From 0b559a9d079466da3e14e8070d5374c0d9a5dd12 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 10:13:51 +0000 Subject: [PATCH 5/8] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- 2 files changed, 21 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 7240e95..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: python-boto -# $Id: Makefile,v 1.1 2007/08/31 01:21:00 petersen Exp $ -NAME := python-boto -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) From da1ca05216a844c3946bdb8915ab7c97521e1008 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Thu, 18 Nov 2010 22:14:48 +0100 Subject: [PATCH 6/8] Added patch to fix parameter of build_list_params() (#647005) --- python-boto-1.9b-prefix.patch | 15 +++++++++++++++ python-boto.spec | 7 ++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 python-boto-1.9b-prefix.patch diff --git a/python-boto-1.9b-prefix.patch b/python-boto-1.9b-prefix.patch new file mode 100644 index 0000000..9f8eb7f --- /dev/null +++ b/python-boto-1.9b-prefix.patch @@ -0,0 +1,15 @@ +The build_list_parameters function only contains half of the fix applied by upstream +commit 79f6a6cc7b2420440091. Specifically, line 78 refers to a function parameter that +was renamed. More details at: https://bugzilla.redhat.com/show_bug.cgi?id=647005 + +--- boto-1.9b/boto/ec2/blockdevicemapping.py 2009-12-16 17:21:40.000000000 +0100 ++++ boto-1.9b/boto/ec2/blockdevicemapping.py.prefix 2010-11-18 21:59:07.000000000 +0100 +@@ -75,7 +75,7 @@ + def build_list_params(self, params, prefix=''): + i = 1 + for dev_name in self: +- pre = '%sBlockDeviceMapping.%d' % (pre, i) ++ pre = '%sBlockDeviceMapping.%d' % (prefix, i) + params['%s.DeviceName' % pre] = dev_name + ebs = self[dev_name] + if ebs.snapshot_id: diff --git a/python-boto.spec b/python-boto.spec index 0aae22e..d22c076 100644 --- a/python-boto.spec +++ b/python-boto.spec @@ -4,12 +4,13 @@ Summary: A simple lightweight interface to Amazon Web Services Name: python-boto Version: 1.9b -Release: 3%{?dist} +Release: 4%{?dist} License: MIT Group: Development/Languages URL: http://code.google.com/p/%{pkgname}/ Source: http://boto.googlecode.com/files/%{pkgname}-%{version}.tar.gz Patch0: python-boto-1.9b-image.patch +Patch1: python-boto-1.9b-prefix.patch BuildRequires: python-devel, python-setuptools-devel BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -24,6 +25,7 @@ use, lightweight wrapper around the Amazon services. %prep %setup -q -n %{pkgname}-%{version} %patch0 -p1 -b .image +%patch1 -p1 -b .prefix %build %{__python} setup.py build @@ -48,6 +50,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/* %changelog +* Thu Nov 18 2010 Robert Scheck 1.9b-4 +- Added patch to fix parameter of build_list_params() (#647005) + * Wed Jul 21 2010 David Malcolm - 1.9b-3 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild From adb5c7cfa8fada2337774e6b22930ec2f15031cd Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Thu, 2 Dec 2010 11:20:24 +0100 Subject: [PATCH 7/8] Patch for python 2.7 --- python-boto-1.9b-python27.patch | 27 +++++++++++++++++++++++++++ python-boto.spec | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 python-boto-1.9b-python27.patch diff --git a/python-boto-1.9b-python27.patch b/python-boto-1.9b-python27.patch new file mode 100644 index 0000000..2cd3963 --- /dev/null +++ b/python-boto-1.9b-python27.patch @@ -0,0 +1,27 @@ +From 6760075073c34d6dddb7e13b80dfa8d09f0f4f79 Mon Sep 17 00:00:00 2001 +From: Mitch.Garnaat +Date: Tue, 6 Jul 2010 22:33:07 +0000 +Subject: [PATCH] Kludge the existing kludge to handle httplib differences. Fixes issue 408. + +--- + boto/connection.py | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + +diff --git a/boto/connection.py b/boto/connection.py +index c5779e2..71942f1 100644 +--- a/boto/connection.py ++++ b/boto/connection.py +@@ -252,8 +252,9 @@ class AWSAuthConnection(object): + # versions, it would append ":443" to the hostname sent + # in the Host header and so we needed to make sure we + # did the same when calculating the V2 signature. In 2.6 ++ # (and higher!) + # it no longer does that. Hence, this kludge. +- if sys.version[:3] == "2.6" and port == 443: ++ if sys.version[:3] in ('2.6', '2.7') and port == 443: + signature_host = self.host + else: + signature_host = '%s:%d' % (self.host, port) +-- +1.7.3.1 + diff --git a/python-boto.spec b/python-boto.spec index d22c076..e408d38 100644 --- a/python-boto.spec +++ b/python-boto.spec @@ -4,13 +4,14 @@ Summary: A simple lightweight interface to Amazon Web Services Name: python-boto Version: 1.9b -Release: 4%{?dist} +Release: 5%{?dist} License: MIT Group: Development/Languages URL: http://code.google.com/p/%{pkgname}/ Source: http://boto.googlecode.com/files/%{pkgname}-%{version}.tar.gz Patch0: python-boto-1.9b-image.patch Patch1: python-boto-1.9b-prefix.patch +Patch2: python-boto-1.9b-python27.patch BuildRequires: python-devel, python-setuptools-devel BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -26,6 +27,7 @@ use, lightweight wrapper around the Amazon services. %setup -q -n %{pkgname}-%{version} %patch0 -p1 -b .image %patch1 -p1 -b .prefix +%patch2 -p1 -b .python27 %build %{__python} setup.py build @@ -50,6 +52,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/* %changelog +* Thu Dec 02 2010 Lubomir Rintel 1.9b-5 +- Apply a patch for python 2.7 support (#659248) + * Thu Nov 18 2010 Robert Scheck 1.9b-4 - Added patch to fix parameter of build_list_params() (#647005) From 73b1fdc38b9ecd86775c4cece6e2a0a4a3b5b5c8 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Mon, 3 Jan 2011 00:02:13 +0100 Subject: [PATCH 8/8] Added a patch for python 2.4 support (#656446, #661233) --- python-boto-1.9b-python24.patch | 121 ++++++++++++++++++++++++++++++++ python-boto.spec | 11 ++- 2 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 python-boto-1.9b-python24.patch diff --git a/python-boto-1.9b-python24.patch b/python-boto-1.9b-python24.patch new file mode 100644 index 0000000..3b593d2 --- /dev/null +++ b/python-boto-1.9b-python24.patch @@ -0,0 +1,121 @@ +Patch by Robert Scheck for boto >= 1.9b, which replaces +ternary operator and with-statement context usages by python 2.4 compatible stuff. +It also works around PEP 341 (Unifying try-except and try-finally). + +--- boto-1.9b/boto/manage/server.py 2009-12-13 16:32:54.000000000 +0100 ++++ boto-1.9b/boto/manage/server.py.python24 2011-01-02 23:36:53.000000000 +0100 +@@ -22,7 +22,6 @@ + """ + High-level abstraction of an EC2 server + """ +-from __future__ import with_statement + import boto.ec2 + from boto.mashups.iobject import IObject + from boto.pyami.config import BotoConfigPath, Config +@@ -328,7 +327,10 @@ + for instance in instances: + s = cls() + s.ec2 = ec2 +- s.name = params.get('name') + '' if i==0 else str(i) ++ if i == 0: ++ s.name = params.get('name') + '' ++ else: ++ s.name = str(i) + s.description = params.get('description') + s.region_name = region.name + s.instance_id = instance.id +@@ -522,8 +524,11 @@ + self._cmdshell = None + + def run(self, command): +- with closing(self.get_cmdshell()) as cmd: ++ try: ++ cmd = self.get_cmdshell() + status = cmd.run(command) ++ finally: ++ cmd.close() + return status + + def get_bundler(self, uname='root'): +--- boto-1.9b/boto/manage/volume.py 2009-11-24 04:47:51.000000000 +0100 ++++ boto-1.9b/boto/manage/volume.py.python24 2011-01-02 23:55:51.000000000 +0100 +@@ -19,7 +19,6 @@ + # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + # IN THE SOFTWARE. + +-from __future__ import with_statement + from boto.sdb.db.model import Model + from boto.sdb.db.property import * + from boto.manage.server import Server +@@ -232,28 +231,33 @@ + def wait(self): + if self.server == None: + raise ValueError, 'server attribute must be set to run this command' +- with closing(self.server.get_cmdshell()) as cmd: ++ try: + # wait for the volume device to appear + cmd = self.server.get_cmdshell() + while not cmd.exists(self.device): + boto.log.info('%s still does not exist, waiting 10 seconds' % self.device) + time.sleep(10) ++ finally: ++ cmd.close() + + def format(self): + if self.server == None: + raise ValueError, 'server attribute must be set to run this command' + status = None +- with closing(self.server.get_cmdshell()) as cmd: ++ try: ++ cmd = self.server.get_cmdshell() + if not self.checkfs(cmd): + boto.log.info('make_fs...') + status = cmd.run('mkfs -t xfs %s' % self.device) ++ finally: ++ cmd.close() + return status + + def mount(self): + if self.server == None: + raise ValueError, 'server attribute must be set to run this command' + boto.log.info('handle_mount_point') +- with closing(self.server.get_cmdshell()) as cmd: ++ try: + cmd = self.server.get_cmdshell() + if not cmd.isdir(self.mount_point): + boto.log.info('making directory') +@@ -276,6 +280,8 @@ + # Mount up our new EBS volume onto mount_point + cmd.run("mount %s %s" % (self.device, self.mount_point)) + cmd.run('xfs_growfs %s' % self.mount_point) ++ finally: ++ cmd.close() + + def make_ready(self, server): + self.server = server +@@ -298,15 +304,16 @@ + # if this volume is attached to a server + # we need to freeze the XFS file system + try: +- self.freeze() +- if self.server == None: +- snapshot = self.get_ec2_connection().create_snapshot(self.volume_id) +- else: +- snapshot = self.server.ec2.create_snapshot(self.volume_id) +- boto.log.info('Snapshot of Volume %s created: %s' % (self.name, snapshot)) +- except Exception, e: +- boto.log.info('Snapshot error') +- boto.log.info(traceback.format_exc()) ++ try: ++ self.freeze() ++ if self.server == None: ++ snapshot = self.get_ec2_connection().create_snapshot(self.volume_id) ++ else: ++ snapshot = self.server.ec2.create_snapshot(self.volume_id) ++ boto.log.info('Snapshot of Volume %s created: %s' % (self.name, snapshot)) ++ except Exception, e: ++ boto.log.info('Snapshot error') ++ boto.log.info(traceback.format_exc()) + finally: + status = self.unfreeze() + return status diff --git a/python-boto.spec b/python-boto.spec index e408d38..2388899 100644 --- a/python-boto.spec +++ b/python-boto.spec @@ -1,10 +1,10 @@ -%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%define pkgname boto +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%global pkgname boto Summary: A simple lightweight interface to Amazon Web Services Name: python-boto Version: 1.9b -Release: 5%{?dist} +Release: 6%{?dist} License: MIT Group: Development/Languages URL: http://code.google.com/p/%{pkgname}/ @@ -12,6 +12,7 @@ Source: http://boto.googlecode.com/files/%{pkgname}-%{version}.tar.gz Patch0: python-boto-1.9b-image.patch Patch1: python-boto-1.9b-prefix.patch Patch2: python-boto-1.9b-python27.patch +Patch3: python-boto-1.9b-python24.patch BuildRequires: python-devel, python-setuptools-devel BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -28,6 +29,7 @@ use, lightweight wrapper around the Amazon services. %patch0 -p1 -b .image %patch1 -p1 -b .prefix %patch2 -p1 -b .python27 +%patch3 -p1 -b .python24 %build %{__python} setup.py build @@ -52,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/* %changelog +* Sun Jan 02 2011 Robert Scheck 1.9b-6 +- Added a patch for python 2.4 support (#656446, #661233) + * Thu Dec 02 2010 Lubomir Rintel 1.9b-5 - Apply a patch for python 2.7 support (#659248)