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):