forked from pool/python-apache-libcloud
25 lines
878 B
Diff
25 lines
878 B
Diff
|
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):
|