From 1e46830db8716e246e854fb20f0784bdf355e693dc4918257cc61f843b58c2d7 Mon Sep 17 00:00:00 2001 From: Niels Abspoel Date: Fri, 28 Sep 2018 20:50:48 +0000 Subject: [PATCH] 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 --- ec2_create_node.patch | 24 ++++++++++++++++++++++++ python-apache-libcloud.changes | 6 ++++++ python-apache-libcloud.spec | 4 +++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 ec2_create_node.patch 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