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
This commit is contained in:
parent
81307fe027
commit
57fcad3880
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5cd4905ce2a6016c52ba359ba774fce513c06cbd4cc10bf855c49bd080ab7d2e
|
||||
size 1851322
|
@ -1,19 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQKlBAABCgCPFiEEmXgo3GL3Wc6hidZeLAdUss4GkvMFAmGOhJ5fFIAAAAAALgAo
|
||||
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk5
|
||||
NzgyOERDNjJGNzU5Q0VBMTg5RDY1RTJDMDc1NEIyQ0UwNjkyRjMRHHRvbWF6QGFw
|
||||
YWNoZS5vcmcACgkQLAdUss4GkvPq2BAApXsqo5vSiDywWNB5tOe+OCbjaWhCC16R
|
||||
QwvM1kPhT21bAOxSkxZiOY1sTMDtaRFtLefABEhiUR0dFIzYO9cWm/RhndqRT4cZ
|
||||
matwkle94KpzcyxUJQ7YRkfgmO3O0IA9cW8en66XfR+OpEVbjA3scCiyr73OC98f
|
||||
bNpqnR5goZDJF7/JeNqEKR4e/kqXKwzBUofkH7salF7ZL2lnFSaztgqshyehhnPe
|
||||
eGZ/ypI59BiweTAa/+uEqWIBIQKa5LWzDk1Ui/hBelerhYPvVL5WasWTG3BdTWW+
|
||||
4KXI1Py0NUuHXdx84BwNY3A1sbaLV2u1UtkmHdHXE3+vnN2i9aDIxI5Kq/5p6JO3
|
||||
NYt0trbrSySp4TevSh/rxXxNoyH2v+y2Y42o210p7GCOM9TO8fMSmx5Qh7QrelVe
|
||||
UbRrIJ+/sTEvxeETSh19FGPLvFQAwkUnlRK1iXSTQhMLEQvvgRkG1B9pxMrPxM4W
|
||||
C/ZZhXswQFlL1dk0bxt2FHZEthjr+Y9hG97UOiJu3D+jjLTa/We+kMA+YBvzRvh7
|
||||
YVrGgJA0C2AfUtHTJx/HEm5F7G2ssyBLKTLrYX1v2kVoxla3cq7o9DaBkFO5JJhW
|
||||
zDiU9Bsqybs9O96GUDudzm9ZofBXQdtbCo4BQnSXoG3aDuX+hbcujMYohi3mUsbP
|
||||
z26cS9vbO4g=
|
||||
=mmFX
|
||||
-----END PGP SIGNATURE-----
|
3
apache-libcloud-3.5.1.tar.bz2
Normal file
3
apache-libcloud-3.5.1.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8f4d98fdf57321a77dc3c6a4f62710dcf230e51c810f4664fd343fdffac14cad
|
||||
size 1859270
|
19
apache-libcloud-3.5.1.tar.bz2.asc
Normal file
19
apache-libcloud-3.5.1.tar.bz2.asc
Normal file
@ -0,0 +1,19 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQKlBAABCgCPFiEEmXgo3GL3Wc6hidZeLAdUss4GkvMFAmI8iE9fFIAAAAAALgAo
|
||||
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk5
|
||||
NzgyOERDNjJGNzU5Q0VBMTg5RDY1RTJDMDc1NEIyQ0UwNjkyRjMRHHRvbWF6QGFw
|
||||
YWNoZS5vcmcACgkQLAdUss4GkvONDA//a7BXU1NSlsp3Ia/CLojXUaAJcq2KsEDQ
|
||||
uPi8jto+/Nq2iV2eYvIjyE7gYJOPX23nf+MPy5kOixA/2gHZBqJGATXWlCMPU+YJ
|
||||
w8WcKEOx4rXAsZECyYEQjP/dDFilpi+jh1YMxpNZ4/3pN44eMC/jup6xJdRhBeDc
|
||||
6gYaiLd59OJo1kYAUzO29WcewL0Zr+QVItzy8sFh7eChnhK31kaOwLOfUlcb1JMq
|
||||
OboVUkjnlK4ew37AkuzICTnFZ7a2SEjStCBmRzu2Zh26rtgE+SAQBgalbSSl/87O
|
||||
5CiIoWPKudlW97s0bxKaT51KfbtGTQ0q6cNMvq9rX6sEVoYeiCoNW/VYXS6s3P3v
|
||||
sr81wZxeTFJoBrSsFYQGiz+zXcMNxjrZcNtH1cun+Y/ld8I8t9c1NZ6A0TgZnGmN
|
||||
5hywAGzzcYOckkLZX09cGyDicQcbmtdR3RzxT8qCz6XZf1U6egTM369gX/g1XMsY
|
||||
9JUDQa44devXC/yifRqZAaP7eWP7vY1cXDliLh8PpfTLwUkiStJFpLAgXqiswOvm
|
||||
C+Xw9A7YUVnd/pQGtDaE6qfExlCPBlKi1H7FyMX2GnNKW0SgYS2xcysAXfCSIv/6
|
||||
I8adC2OfOlkarV7eRDPFhm4cZSIG2pu3bbRaXePF8N+mQ82T/TdPuz3dTLIwGPej
|
||||
vU5lrGycUR4=
|
||||
=2iK8
|
||||
-----END PGP SIGNATURE-----
|
@ -1,8 +1,8 @@
|
||||
Index: apache-libcloud-3.0.0/libcloud/compute/drivers/ec2.py
|
||||
Index: apache-libcloud-3.5.1/libcloud/compute/drivers/ec2.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.0.0.orig/libcloud/compute/drivers/ec2.py
|
||||
+++ apache-libcloud-3.0.0/libcloud/compute/drivers/ec2.py
|
||||
@@ -1902,12 +1902,18 @@ class BaseEC2NodeDriver(NodeDriver):
|
||||
--- 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``
|
||||
"""
|
||||
@ -13,12 +13,12 @@ Index: apache-libcloud-3.0.0/libcloud/compute/drivers/ec2.py
|
||||
+ instance_type = size
|
||||
+
|
||||
params = {
|
||||
'Action': 'RunInstances',
|
||||
'ImageId': image.id,
|
||||
'MinCount': str(ex_mincount),
|
||||
'MaxCount': str(ex_maxcount),
|
||||
- 'InstanceType': size.id
|
||||
+ 'InstanceType': instance_type
|
||||
"Action": "RunInstances",
|
||||
"ImageId": image.id,
|
||||
"MinCount": str(ex_mincount),
|
||||
"MaxCount": str(ex_maxcount),
|
||||
- "InstanceType": size.id,
|
||||
+ "InstanceType": instance_type,
|
||||
}
|
||||
|
||||
if ex_terminate_on_shutdown:
|
||||
|
@ -1,34 +1,29 @@
|
||||
Index: apache-libcloud-3.0.0/libcloud/compute/drivers/gce.py
|
||||
Index: apache-libcloud-3.5.1/libcloud/compute/drivers/gce.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.0.0.orig/libcloud/compute/drivers/gce.py
|
||||
+++ apache-libcloud-3.0.0/libcloud/compute/drivers/gce.py
|
||||
@@ -1820,20 +1820,35 @@ class GCENodeDriver(NodeDriver):
|
||||
"rhel-8",
|
||||
],
|
||||
"suse-cloud": [
|
||||
- "sles-11",
|
||||
"sles-12",
|
||||
"sles-15",
|
||||
],
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/compute/drivers/gce.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/compute/drivers/gce.py
|
||||
@@ -1981,12 +1981,19 @@ class GCENodeDriver(NodeDriver):
|
||||
"debian-cloud": ["debian-8", "debian-9", "debian-10"],
|
||||
"opensuse-cloud": ["opensuse-leap"],
|
||||
"rhel-cloud": ["rhel-6", "rhel-7", "rhel-8"],
|
||||
- "suse-cloud": ["sles-11", "sles-12", "sles-15"],
|
||||
+ "suse-cloud": ["sles-12", "sles-15"],
|
||||
"suse-byos-cloud": [
|
||||
- "sles-11-byos", "sles-12-byos",
|
||||
- "sles-12-sp2-sap-byos", "sles-12-sp3-sap-byos",
|
||||
- "suse-manager-proxy-byos", "suse-manager-server-byos"
|
||||
+ "sles-11-byos",
|
||||
+ "sles-12-byos",
|
||||
"sles-11-byos",
|
||||
"sles-12-byos",
|
||||
+ "sles-15-byos",
|
||||
+ "sles-12-sp1-sap-byos",
|
||||
+ "sles-12-sp2-sap-byos",
|
||||
+ "sles-12-sp3-sap-byos",
|
||||
"sles-12-sp2-sap-byos",
|
||||
"sles-12-sp3-sap-byos",
|
||||
+ "sles-12-sp4-sap-byos",
|
||||
+ "sles-12-sp5-sap-byos",
|
||||
+ "sles-15-sap-byos",
|
||||
+ "sles-15-sp1-sap-byos",
|
||||
+ "sles-15-sp1-chost-byos",
|
||||
+ "suse-manager-proxy",
|
||||
+ "suse-manager-server"
|
||||
"suse-manager-proxy-byos",
|
||||
"suse-manager-server-byos",
|
||||
],
|
||||
"suse-sap-cloud": [
|
||||
@@ -1994,7 +2001,13 @@ class GCENodeDriver(NodeDriver):
|
||||
"sles-12-sp2-sap",
|
||||
"sles-12-sp3-sap",
|
||||
"sles-12-sp4-sap",
|
||||
|
490
mock.patch
Normal file
490
mock.patch
Normal file
@ -0,0 +1,490 @@
|
||||
From e62bb28cdbd685203d44a9a4028f311ea155476c Mon Sep 17 00:00:00 2001
|
||||
From: Tomaz Muraus <tomaz@tomaz.me>
|
||||
Date: Tue, 10 May 2022 23:44:18 +0200
|
||||
Subject: [PATCH] Use unittest.mock library from stdlib instead of using 3rd
|
||||
party mock dependency.
|
||||
|
||||
Reported by @pgajdos, closes #1684.
|
||||
---
|
||||
libcloud/test/common/test_aws.py | 2 +-
|
||||
libcloud/test/common/test_base.py | 2 +-
|
||||
libcloud/test/common/test_base_driver.py | 2 +-
|
||||
libcloud/test/common/test_google.py | 2 +-
|
||||
libcloud/test/common/test_nfsn.py | 2 +-
|
||||
libcloud/test/common/test_openstack.py | 2 +-
|
||||
libcloud/test/common/test_openstack_identity.py | 2 +-
|
||||
libcloud/test/common/test_retry_limit.py | 2 +-
|
||||
libcloud/test/common/test_upcloud.py | 2 +-
|
||||
libcloud/test/compute/test_azure_arm.py | 2 +-
|
||||
libcloud/test/compute/test_deployment.py | 2 +-
|
||||
libcloud/test/compute/test_gce.py | 2 +-
|
||||
libcloud/test/compute/test_gig_g8.py | 2 +-
|
||||
libcloud/test/compute/test_libvirt_driver.py | 2 +-
|
||||
libcloud/test/compute/test_openstack.py | 4 ++--
|
||||
libcloud/test/compute/test_ovh.py | 2 +-
|
||||
libcloud/test/compute/test_ssh_client.py | 2 +-
|
||||
libcloud/test/compute/test_vcloud.py | 2 +-
|
||||
libcloud/test/dns/test_base.py | 2 +-
|
||||
libcloud/test/dns/test_durabledns.py | 2 +-
|
||||
libcloud/test/dns/test_zonomi.py | 2 +-
|
||||
libcloud/test/storage/test_backblaze_b2.py | 2 +-
|
||||
libcloud/test/storage/test_base.py | 4 ++--
|
||||
libcloud/test/storage/test_cloudfiles.py | 6 +++---
|
||||
libcloud/test/storage/test_google_storage.py | 6 +++---
|
||||
libcloud/test/storage/test_oss.py | 5 +----
|
||||
libcloud/test/storage/test_s3.py | 6 +++---
|
||||
libcloud/test/test_connection.py | 2 +-
|
||||
libcloud/test/test_init.py | 2 +-
|
||||
libcloud/test/test_logging_connection.py | 2 +-
|
||||
requirements-tests.txt | 1 -
|
||||
setup.py | 1 -
|
||||
35 files changed, 50 insertions(+), 47 deletions(-)
|
||||
|
||||
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/common/test_aws.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/common/test_aws.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/common/test_aws.py
|
||||
@@ -17,7 +17,7 @@ import sys
|
||||
import unittest
|
||||
from datetime import datetime
|
||||
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
|
||||
from libcloud.common.aws import AWSRequestSignerAlgorithmV4
|
||||
from libcloud.common.aws import SignedAWSConnection
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/common/test_base.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/common/test_base.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/common/test_base.py
|
||||
@@ -16,7 +16,7 @@
|
||||
import unittest
|
||||
import sys
|
||||
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
|
||||
from libcloud.common.base import LazyObject, Response
|
||||
from libcloud.common.exceptions import BaseHTTPError, RateLimitReachedError
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/common/test_base_driver.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/common/test_base_driver.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/common/test_base_driver.py
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
import sys
|
||||
|
||||
-from mock import Mock
|
||||
+from unittest.mock import Mock
|
||||
|
||||
from libcloud.common.base import BaseDriver
|
||||
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/common/test_google.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/common/test_google.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/common/test_google.py
|
||||
@@ -16,7 +16,7 @@
|
||||
Tests for Google Connection classes.
|
||||
"""
|
||||
import datetime
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/common/test_nfsn.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/common/test_nfsn.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/common/test_nfsn.py
|
||||
@@ -17,7 +17,7 @@ import string
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
-from mock import Mock, patch
|
||||
+from unittest.mock import Mock, patch
|
||||
|
||||
from libcloud.common.nfsn import NFSNConnection
|
||||
from libcloud.test import LibcloudTestCase, MockHttp
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/common/test_openstack.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/common/test_openstack.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/common/test_openstack.py
|
||||
@@ -17,7 +17,7 @@ import sys
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
-from mock import Mock
|
||||
+from unittest.mock import Mock
|
||||
from libcloud.common.base import LibcloudConnection
|
||||
from libcloud.common.openstack import OpenStackBaseConnection
|
||||
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/common/test_openstack_identity.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/common/test_openstack_identity.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/common/test_openstack_identity.py
|
||||
@@ -21,7 +21,7 @@ try:
|
||||
except ImportError:
|
||||
import json
|
||||
|
||||
-from mock import Mock
|
||||
+from unittest.mock import Mock
|
||||
|
||||
from libcloud.utils.py3 import httplib
|
||||
from libcloud.utils.py3 import assertRaisesRegex
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/common/test_retry_limit.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/common/test_retry_limit.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/common/test_retry_limit.py
|
||||
@@ -16,7 +16,7 @@
|
||||
import socket
|
||||
import ssl
|
||||
|
||||
-from mock import Mock, patch, MagicMock
|
||||
+from unittest.mock import Mock, patch, MagicMock
|
||||
|
||||
from libcloud.utils.retry import TRANSIENT_SSL_ERROR
|
||||
from libcloud.common.base import Connection
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/common/test_upcloud.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/common/test_upcloud.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/common/test_upcloud.py
|
||||
@@ -15,7 +15,7 @@
|
||||
import sys
|
||||
import json
|
||||
|
||||
-from mock import Mock, call
|
||||
+from unittest.mock import Mock, call
|
||||
|
||||
from libcloud.common.upcloud import (
|
||||
UpcloudCreateNodeRequestBody,
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_azure_arm.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_azure_arm.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_azure_arm.py
|
||||
@@ -18,7 +18,7 @@ import sys
|
||||
import functools
|
||||
from datetime import datetime
|
||||
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
|
||||
from libcloud.common.exceptions import BaseHTTPError
|
||||
from libcloud.common.types import LibcloudError
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_deployment.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_deployment.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_deployment.py
|
||||
@@ -39,7 +39,7 @@ from libcloud.compute.drivers.rackspace
|
||||
|
||||
from libcloud.test import MockHttp, XML_HEADERS
|
||||
from libcloud.test.file_fixtures import ComputeFileFixtures
|
||||
-from mock import Mock, patch
|
||||
+from unittest.mock import Mock, patch
|
||||
|
||||
from libcloud.test.secrets import RACKSPACE_PARAMS
|
||||
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_gce.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_gce.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_gce.py
|
||||
@@ -17,7 +17,7 @@ Tests for Google Compute Engine Driver
|
||||
"""
|
||||
|
||||
import datetime
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_gig_g8.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_gig_g8.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_gig_g8.py
|
||||
@@ -18,7 +18,7 @@ import base64
|
||||
import json
|
||||
import time
|
||||
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
|
||||
from libcloud.utils.py3 import httplib
|
||||
from libcloud.test import MockHttp
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_libvirt_driver.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_libvirt_driver.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_libvirt_driver.py
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
import sys
|
||||
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
|
||||
from libcloud.compute.drivers.libvirt_driver import LibvirtNodeDriver
|
||||
from libcloud.compute.drivers.libvirt_driver import have_libvirt
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_openstack.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_openstack.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_openstack.py
|
||||
@@ -19,7 +19,7 @@ import os
|
||||
import sys
|
||||
import unittest
|
||||
import datetime
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
import pytest
|
||||
|
||||
from libcloud.utils.iso8601 import UTC
|
||||
@@ -29,7 +29,7 @@ try:
|
||||
except ImportError:
|
||||
import json
|
||||
|
||||
-from mock import Mock, patch
|
||||
+from unittest.mock import Mock, patch
|
||||
import requests_mock
|
||||
|
||||
from libcloud.utils.py3 import httplib
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_ovh.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_ovh.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_ovh.py
|
||||
@@ -14,7 +14,7 @@
|
||||
# limitations under the License.
|
||||
import sys
|
||||
import unittest
|
||||
-from mock import patch
|
||||
+from unittest.mock import patch
|
||||
|
||||
from libcloud.utils.py3 import httplib
|
||||
from libcloud.common.exceptions import BaseHTTPError
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_ssh_client.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_ssh_client.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_ssh_client.py
|
||||
@@ -32,7 +32,7 @@ from libcloud.utils.py3 import StringIO
|
||||
from libcloud.utils.py3 import u
|
||||
from libcloud.utils.py3 import assertRaisesRegex
|
||||
|
||||
-from mock import patch, Mock, MagicMock, call
|
||||
+from unittest.mock import patch, Mock, MagicMock, call
|
||||
|
||||
if not have_paramiko:
|
||||
ParamikoSSHClient = None # NOQA
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_vcloud.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_vcloud.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_vcloud.py
|
||||
@@ -45,7 +45,7 @@ from libcloud.compute.types import NodeS
|
||||
from libcloud.test import MockHttp
|
||||
from libcloud.test.compute import TestCaseMixin
|
||||
from libcloud.test.file_fixtures import ComputeFileFixtures
|
||||
-from mock import patch, mock_open
|
||||
+from unittest.mock import patch, mock_open
|
||||
|
||||
from libcloud.test.secrets import VCLOUD_PARAMS
|
||||
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/dns/test_base.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/dns/test_base.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/dns/test_base.py
|
||||
@@ -18,7 +18,7 @@ import sys
|
||||
import tempfile
|
||||
import datetime
|
||||
|
||||
-from mock import Mock
|
||||
+from unittest.mock import Mock
|
||||
|
||||
from libcloud import __version__
|
||||
from libcloud.test import unittest
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/dns/test_durabledns.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/dns/test_durabledns.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/dns/test_durabledns.py
|
||||
@@ -15,7 +15,7 @@
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
-from mock import MagicMock
|
||||
+from unittest.mock import MagicMock
|
||||
|
||||
from libcloud.dns.base import Record, Zone
|
||||
from libcloud.dns.types import RecordType
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/dns/test_zonomi.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/dns/test_zonomi.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/dns/test_zonomi.py
|
||||
@@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
import sys
|
||||
import unittest
|
||||
-from mock import MagicMock
|
||||
+from unittest.mock import MagicMock
|
||||
|
||||
|
||||
from libcloud.test import MockHttp
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/storage/test_backblaze_b2.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/storage/test_backblaze_b2.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/storage/test_backblaze_b2.py
|
||||
@@ -17,7 +17,7 @@ import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
import json
|
||||
|
||||
from libcloud.storage.drivers.backblaze_b2 import BackblazeB2StorageDriver
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/storage/test_base.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/storage/test_base.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/storage/test_base.py
|
||||
@@ -18,8 +18,8 @@ import hashlib
|
||||
import sys
|
||||
from io import BytesIO
|
||||
|
||||
-import mock
|
||||
-from mock import Mock
|
||||
+from unittest import mock
|
||||
+from unittest.mock import Mock
|
||||
|
||||
from libcloud.common.exceptions import RateLimitReachedError
|
||||
from libcloud.storage.base import DEFAULT_CONTENT_TYPE
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/storage/test_cloudfiles.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/storage/test_cloudfiles.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/storage/test_cloudfiles.py
|
||||
@@ -24,9 +24,9 @@ from io import BytesIO
|
||||
import hashlib
|
||||
from hashlib import sha1
|
||||
|
||||
-import mock
|
||||
-from mock import Mock
|
||||
-from mock import PropertyMock
|
||||
+from unittest import mock
|
||||
+from unittest.mock import Mock
|
||||
+from unittest.mock import PropertyMock
|
||||
|
||||
import libcloud.utils.files
|
||||
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/storage/test_google_storage.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/storage/test_google_storage.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/storage/test_google_storage.py
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
import copy
|
||||
import json
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
import re
|
||||
import sys
|
||||
import unittest
|
||||
@@ -24,8 +24,8 @@ from io import BytesIO
|
||||
|
||||
import email.utils
|
||||
import pytest
|
||||
-from mock import Mock
|
||||
-from mock import PropertyMock
|
||||
+from unittest.mock import Mock
|
||||
+from unittest.mock import PropertyMock
|
||||
|
||||
from libcloud.common.google import GoogleAuthType
|
||||
from libcloud.common.types import InvalidCredsError
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/storage/test_oss.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/storage/test_oss.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/storage/test_oss.py
|
||||
@@ -19,10 +19,7 @@ import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
-try:
|
||||
- import mock
|
||||
-except ImportError:
|
||||
- from unittest import mock
|
||||
+from unittest import mock
|
||||
|
||||
from libcloud.utils.py3 import b
|
||||
from libcloud.utils.py3 import httplib
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/storage/test_s3.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/storage/test_s3.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/storage/test_s3.py
|
||||
@@ -21,9 +21,9 @@ import sys
|
||||
from io import BytesIO
|
||||
from hashlib import sha1
|
||||
|
||||
-import mock
|
||||
-from mock import Mock
|
||||
-from mock import PropertyMock
|
||||
+from unittest import mock
|
||||
+from unittest.mock import Mock
|
||||
+from unittest.mock import PropertyMock
|
||||
import libcloud.utils.files # NOQA: F401
|
||||
|
||||
from libcloud.utils.py3 import ET
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/test_connection.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/test_connection.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/test_connection.py
|
||||
@@ -21,7 +21,7 @@ import sys
|
||||
from unittest import mock
|
||||
|
||||
import requests_mock
|
||||
-from mock import Mock, patch
|
||||
+from unittest.mock import Mock, patch
|
||||
from requests.exceptions import ConnectTimeout
|
||||
|
||||
import libcloud.common.base
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/test_init.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/test_init.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/test_init.py
|
||||
@@ -26,7 +26,7 @@ try:
|
||||
except ImportError:
|
||||
have_paramiko = False
|
||||
|
||||
-from mock import patch
|
||||
+from unittest.mock import patch
|
||||
|
||||
import libcloud
|
||||
from libcloud import _init_once
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/test_logging_connection.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/test_logging_connection.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/test_logging_connection.py
|
||||
@@ -19,7 +19,7 @@ from io import StringIO
|
||||
import zlib
|
||||
import requests_mock
|
||||
|
||||
-import mock
|
||||
+from unittest import mock
|
||||
|
||||
import libcloud
|
||||
from libcloud.test import unittest
|
||||
Index: apache-libcloud-3.5.1/requirements-tests.txt
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/requirements-tests.txt
|
||||
+++ apache-libcloud-3.5.1/requirements-tests.txt
|
||||
@@ -2,7 +2,6 @@ pep8==1.7.1
|
||||
flake8==4.0.1
|
||||
astroid==2.8.4
|
||||
pylint==2.11.1
|
||||
-mock==4.0.3
|
||||
codecov==2.1.12
|
||||
coverage==4.5.4
|
||||
requests>=2.27.1
|
||||
Index: apache-libcloud-3.5.1/setup.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.5.1.orig/setup.py
|
||||
+++ apache-libcloud-3.5.1/setup.py
|
||||
@@ -208,7 +208,6 @@ if setuptools_version < (36, 2):
|
||||
raise RuntimeError(msg)
|
||||
|
||||
TEST_REQUIREMENTS = [
|
||||
- "mock",
|
||||
"requests_mock",
|
||||
"pytest",
|
||||
"pytest-runner",
|
@ -1,3 +1,17 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri May 13 11:21:00 UTC 2022 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- 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
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 9 10:39:35 UTC 2021 - pgajdos@suse.com
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-apache-libcloud
|
||||
#
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -20,7 +20,7 @@
|
||||
%define skip_python2 1
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-apache-libcloud
|
||||
Version: 3.4.1
|
||||
Version: 3.5.1
|
||||
Release: 0
|
||||
Summary: Abstraction over multiple cloud provider APIs
|
||||
License: Apache-2.0
|
||||
@ -33,10 +33,11 @@ Source2: https://www.apache.org/dist/libcloud/KEYS#/%{name}.keyring
|
||||
Patch1: gce_image_projects.patch
|
||||
Patch2: ec2_create_node.patch
|
||||
Patch3: skip-some-tests-for-older-paramiko-versions.patch
|
||||
# PATCH-FIX-UPSTREAM https://github.com/Kami/libcloud/commit/e62bb28cdbd685203d44a9a4028f311ea155476c Use unittest.mock library from stdlib instead of using 3rd party mock dependency.
|
||||
Patch4: mock.patch
|
||||
BuildRequires: %{python_module libvirt-python}
|
||||
BuildRequires: %{python_module lockfile}
|
||||
BuildRequires: %{python_module lxml}
|
||||
BuildRequires: %{python_module mock}
|
||||
BuildRequires: %{python_module paramiko}
|
||||
BuildRequires: %{python_module pyOpenSSL}
|
||||
BuildRequires: %{python_module pytest}
|
||||
@ -62,9 +63,7 @@ differences among multiple cloud provider APIs.
|
||||
|
||||
%prep
|
||||
%setup -q -n apache-libcloud-%{version}
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%autopatch -p1
|
||||
sed -i '/^#!/d' demos/gce_demo.py
|
||||
chmod a-x demos/gce_demo.py
|
||||
# Setup tests
|
||||
|
@ -1,31 +1,31 @@
|
||||
Index: apache-libcloud-3.2.0/libcloud/test/compute/test_ssh_client.py
|
||||
Index: apache-libcloud-3.5.1/libcloud/test/compute/test_ssh_client.py
|
||||
===================================================================
|
||||
--- apache-libcloud-3.2.0.orig/libcloud/test/compute/test_ssh_client.py
|
||||
+++ apache-libcloud-3.2.0/libcloud/test/compute/test_ssh_client.py
|
||||
@@ -168,6 +168,8 @@ class ParamikoSSHClientTests(LibcloudTes
|
||||
expected_msg, mock.connect)
|
||||
--- apache-libcloud-3.5.1.orig/libcloud/test/compute/test_ssh_client.py
|
||||
+++ apache-libcloud-3.5.1/libcloud/test/compute/test_ssh_client.py
|
||||
@@ -193,6 +193,8 @@ class ParamikoSSHClientTests(LibcloudTes
|
||||
)
|
||||
|
||||
@patch('paramiko.SSHClient', Mock)
|
||||
@patch("paramiko.SSHClient", Mock)
|
||||
+ @unittest.skipIf(paramiko_version < '2.7.0',
|
||||
+ 'Old versions of paramiko do not support OPENSSH key format')
|
||||
def test_password_protected_key_no_password_provided_1(self):
|
||||
path = os.path.join(os.path.dirname(__file__),
|
||||
'fixtures', 'misc',
|
||||
@@ -198,6 +200,8 @@ class ParamikoSSHClientTests(LibcloudTes
|
||||
expected_msg, mock.connect)
|
||||
path = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
@@ -238,6 +240,8 @@ class ParamikoSSHClientTests(LibcloudTes
|
||||
)
|
||||
|
||||
@patch('paramiko.SSHClient', Mock)
|
||||
@patch("paramiko.SSHClient", Mock)
|
||||
+ @unittest.skipIf(paramiko_version < '2.7.0',
|
||||
+ 'Old versions of paramiko do not support OPENSSH key format')
|
||||
def test_password_protected_key_no_password_provided_2(self):
|
||||
path = os.path.join(os.path.dirname(__file__),
|
||||
'fixtures', 'misc',
|
||||
@@ -219,6 +223,8 @@ class ParamikoSSHClientTests(LibcloudTes
|
||||
expected_msg, mock.connect)
|
||||
path = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
@@ -265,6 +269,8 @@ class ParamikoSSHClientTests(LibcloudTes
|
||||
)
|
||||
|
||||
@patch('paramiko.SSHClient', Mock)
|
||||
@patch("paramiko.SSHClient", Mock)
|
||||
+ @unittest.skipIf(paramiko_version < '2.7.0',
|
||||
+ 'Old versions of paramiko do not support OPENSSH key format')
|
||||
def test_password_protected_key_valid_password_provided(self):
|
||||
path = os.path.join(os.path.dirname(__file__),
|
||||
'fixtures', 'misc',
|
||||
path = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
|
Loading…
Reference in New Issue
Block a user