python-apache-libcloud/ec2_create_node.patch

23 lines
784 B
Diff
Raw Normal View History

--- apache-libcloud-2.4.0/libcloud/compute/drivers/ec2.py.orig 2019-02-25 17:38:58.959040486 +0700
+++ apache-libcloud-2.4.0/libcloud/compute/drivers/ec2.py 2019-02-25 17:39:13.791169683 +0700
@@ -1865,12 +1865,18 @@
"""
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):