diff --git a/ec2_create_node.patch b/ec2_create_node.patch new file mode 100644 index 0000000..f333252 --- /dev/null +++ b/ec2_create_node.patch @@ -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): diff --git a/python-apache-libcloud.changes b/python-apache-libcloud.changes index 84e27a0..a5040e1 100644 --- a/python-apache-libcloud.changes +++ b/python-apache-libcloud.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Sep 28 20:00:44 UTC 2018 - Sean Marlow + +- 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 diff --git a/python-apache-libcloud.spec b/python-apache-libcloud.spec index 9f7be81..9f9aa82 100644 --- a/python-apache-libcloud.spec +++ b/python-apache-libcloud.spec @@ -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