python-apache-libcloud/ec2_create_node.patch
Pablo Suárez Hernández 57fcad3880 Accepting request 977732 from home:mcalabkova:branches:devel:languages:python
- update to 3.5.1
  * Support for Python 3.5 which has been EOL for more than a year now has been removed.
  * [EC2] Add support for new ap-east-1 region.
  * [OpenStack] OpenStack: Move floating IP functions to use network service instead of nova.
  * [OpenStack] Avoid raising exception if ip is not found. 
  * [GCE] Allow credentials argument which is provided to the driver constructor.
  * [Local Storage] Objects returned by the list_container_objects() method are now returned sorted in the ascending order based on the object name.
  * Also run unit tests under Python 3.10 + Pyjion on CI/CD.
- added upstream patch mock.patch and drop mock requirement
- rebase all other patches

OBS-URL: https://build.opensuse.org/request/show/977732
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-apache-libcloud?expand=0&rev=116
2022-05-17 15:00:07 +00:00

25 lines
877 B
Diff

Index: apache-libcloud-3.5.1/libcloud/compute/drivers/ec2.py
===================================================================
--- apache-libcloud-3.5.1.orig/libcloud/compute/drivers/ec2.py
+++ apache-libcloud-3.5.1/libcloud/compute/drivers/ec2.py
@@ -1622,12 +1622,18 @@ class BaseEC2NodeDriver(NodeDriver):
on-demand price will be used.
:type ex_spot_max_price: ``float``
"""
+
+ try:
+ instance_type = size.id
+ except AttributeError:
+ instance_type = size
+
params = {
"Action": "RunInstances",
"ImageId": image.id,
"MinCount": str(ex_mincount),
"MaxCount": str(ex_maxcount),
- "InstanceType": size.id,
+ "InstanceType": instance_type,
}
if ex_terminate_on_shutdown: