1
0

Accepting request 639059 from home:seanmarlow:branches:devel:languages:python

Add ec2_create_node.patch to allow for instance type strings in create_node method. This is helpful since instance_types are constantly being added in EC2.

Upstream discussion: https://issues.apache.org/jira/browse/LIBCLOUD-1018

OBS-URL: https://build.opensuse.org/request/show/639059
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-apache-libcloud?expand=0&rev=81
This commit is contained in:
Niels Abspoel 2018-09-28 20:50:48 +00:00 committed by Git OBS Bridge
parent c5b3e8b2d6
commit 1e46830db8
3 changed files with 33 additions and 1 deletions

24
ec2_create_node.patch Normal file
View File

@ -0,0 +1,24 @@
Index: apache-libcloud-2.3.0/libcloud/compute/drivers/ec2.py
===================================================================
--- apache-libcloud-2.3.0.orig/libcloud/compute/drivers/ec2.py
+++ apache-libcloud-2.3.0/libcloud/compute/drivers/ec2.py
@@ -3907,12 +3907,18 @@ class BaseEC2NodeDriver(NodeDriver):
"""
image = kwargs["image"]
size = kwargs["size"]
+
+ try:
+ instance_type = size.id
+ except AttributeError:
+ instance_type = size
+
params = {
'Action': 'RunInstances',
'ImageId': image.id,
'MinCount': str(kwargs.get('ex_mincount', '1')),
'MaxCount': str(kwargs.get('ex_maxcount', '1')),
- 'InstanceType': size.id
+ 'InstanceType': instance_type
}
if kwargs.get("ex_terminate_on_shutdown", False):

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Sep 28 20:00:44 UTC 2018 - Sean Marlow <sean.marlow@suse.com>
- Add ec2_create_node.patch to allow for instance type strings
in create_node method.
-------------------------------------------------------------------
Tue Aug 14 17:57:22 UTC 2018 - sean.marlow@suse.com

View File

@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@ -26,6 +26,7 @@ Group: System/Monitoring
URL: https://libcloud.apache.org
Source0: https://files.pythonhosted.org/packages/source/a/apache-libcloud/apache-libcloud-%{version}.tar.gz
Patch1: image_projects.patch
Patch2: ec2_create_node.patch
BuildRequires: %{python_module lxml}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module xml}
@ -48,6 +49,7 @@ differences among multiple cloud provider APIs.
%prep
%setup -q -n apache-libcloud-%{version}
%patch1 -p1
%patch2 -p1
%build
%python_build