Hello community,
here is the log from the commit of package python-transip for
openSUSE:Leap:15.2 checked in at 2020-03-27 16:44:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-transip (Old)
and /work/SRC/openSUSE:Leap:15.2/.python-transip.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-transip"
Fri Mar 27 16:44:44 2020 rev:16 rq:788663 version:2.1.1
Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-transip/python-transip.changes
2020-03-02 13:24:12.814500506 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.python-transip.new.3160/python-transip.changes
2020-03-27 16:47:15.731902940 +0100
@@ -1,0 +2,9 @@
+Wed Mar 25 15:11:57 UTC 2020 - [email protected]
+
+- version update to 2.1.1
+ * Fixed syntax problem in README.rst.
+ * Added a workaround for backwards incompatible change in the TransIP SOAP
API.
+ * Fixed bug in `DomainService.get_info`.
+ * Add `remove_dns_entries` and `add_dns_entries` functions on DomainService.
+
+-------------------------------------------------------------------
Old:
----
v2.0.0.tar.gz
New:
----
2.1.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-transip.spec ++++++
--- /var/tmp/diff_new_pack.ALTtXR/_old 2020-03-27 16:47:16.155903189 +0100
+++ /var/tmp/diff_new_pack.ALTtXR/_new 2020-03-27 16:47:16.167903196 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-transip
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,16 +18,16 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-transip
-Version: 2.0.0
+Version: 2.1.1
Release: 0
Summary: TransIP API Connector
License: MIT
Group: Development/Languages/Python
URL: https://github.com/benkonrath/transip-api
-Source:
https://github.com/benkonrath/transip-api/archive/v%{version}.tar.gz
+Source:
https://github.com/benkonrath/transip-api/archive/%{version}.tar.gz
BuildRequires: %{python_module cryptography}
BuildRequires: %{python_module mock}
-BuildRequires: %{python_module nose}
+BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module suds-jurko}
@@ -35,6 +35,7 @@
BuildRequires: python-rpm-macros
Requires: python-cryptography
Requires: python-requests
+Requires: python-setuptools
Requires: python-suds-jurko
BuildArch: noarch
%python_subpackages
@@ -54,7 +55,7 @@
%check
# testConstructor needs network connection
-%python_expand nosetests-%{$python_bin_suffix} -e "test_constructor" -e
"testConstructor"
+%pytest -k 'not (test_constructor or testConstructor)'
%files %{python_files}
%license LICENSE
++++++ v2.0.0.tar.gz -> 2.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/CHANGELOG.rst
new/transip-api-2.1.1/CHANGELOG.rst
--- old/transip-api-2.0.0/CHANGELOG.rst 2019-03-17 15:42:42.000000000 +0100
+++ new/transip-api-2.1.1/CHANGELOG.rst 2020-03-15 22:16:41.000000000 +0100
@@ -5,6 +5,18 @@
This document records all notable changes to `transip-api
<https://github.com/benkonrath/transip-api>`_.
This project adheres to `Semantic Versioning <http://semver.org/>`_.
+`2.1.1`_ (2020-03-15)
+---------------------
+
+* Fixed syntax problem in README.rst.
+
+`2.1.0`_ (2020-03-15)
+---------------------
+
+* Added a workaround for backwards incompatible change in the TransIP SOAP API.
+* Fixed bug in `DomainService.get_info`.
+* Add `remove_dns_entries` and `add_dns_entries` functions on DomainService.
+
`2.0.0`_ (2019-03-17)
---------------------
@@ -46,3 +58,5 @@
.. _1.0.0: https://github.com/benkonrath/transip-api/compare/0.4.1...v1.0.0
.. _1.0.1: https://github.com/benkonrath/transip-api/compare/v1.0.0...v1.0.1
.. _2.0.0: https://github.com/benkonrath/transip-api/compare/v1.0.1...v2.0.0
+.. _2.1.0: https://github.com/benkonrath/transip-api/compare/v2.0.0...v2.1.0
+.. _2.1.1: https://github.com/benkonrath/transip-api/compare/v2.1.0...v2.1.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/README.rst
new/transip-api-2.1.1/README.rst
--- old/transip-api-2.0.0/README.rst 2019-03-17 15:42:42.000000000 +0100
+++ new/transip-api-2.1.1/README.rst 2020-03-15 22:16:41.000000000 +0100
@@ -29,10 +29,11 @@
Setup
-----
-.. code-block::
+You can get the library directly from PyPi:
- $ python setup.py install
+.. code-block::
+ $ pip install transip
Example
-------
@@ -108,7 +109,7 @@
Answer:
The `suds` library has fairly limited SSL support which is dependent on
the Python version, to work around this the `suds_requests` library can be used
which replaces `urllib2` with the `requests` library. Additionally the
`requests` library automatically pools connections which makes the library
slightly faster to use.
- To install:
+ To install:
.. code-block::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/dev_requirements.txt
new/transip-api-2.1.1/dev_requirements.txt
--- old/transip-api-2.0.0/dev_requirements.txt 2019-03-17 15:42:42.000000000
+0100
+++ new/transip-api-2.1.1/dev_requirements.txt 2020-03-15 22:16:41.000000000
+0100
@@ -6,5 +6,7 @@
sphinx
suds-jurko
rsa
+# colorama dropped Python 3.4 in releases >= 0.4.2
+colorama==0.4.1
pylint==1.9.2
-e .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/docs/index.rst
new/transip-api-2.1.1/docs/index.rst
--- old/transip-api-2.0.0/docs/index.rst 2019-03-17 15:42:42.000000000
+0100
+++ new/transip-api-2.1.1/docs/index.rst 2020-03-15 22:16:41.000000000
+0100
@@ -24,9 +24,9 @@
# Order a Vps without addons:
client.order_vps('vps-bladevps-x1', None, 'ubuntu-18.04', 'vps-name')
-You can get the library directly from PyPI::
+You can get the library directly from PyPi::
- pip install transip-api
+ pip install transip
Documentation
-------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/tests/service_tests/test_dns.py
new/transip-api-2.1.1/tests/service_tests/test_dns.py
--- old/transip-api-2.0.0/tests/service_tests/test_dns.py 2019-03-17
15:42:42.000000000 +0100
+++ new/transip-api-2.1.1/tests/service_tests/test_dns.py 2020-03-15
22:16:41.000000000 +0100
@@ -12,5 +12,7 @@
dns_entry_two.expire = 600
self.assertEqual(dns_entry_one, dns_entry_two)
+ self.assertNotEqual(dns_entry_one, [dns_entry_two])
+
dns_entry_two.content = '127.0.0.1'
self.assertNotEqual(dns_entry_one, dns_entry_two)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/tests/service_tests/test_domain.py
new/transip-api-2.1.1/tests/service_tests/test_domain.py
--- old/transip-api-2.0.0/tests/service_tests/test_domain.py 2019-03-17
15:42:42.000000000 +0100
+++ new/transip-api-2.1.1/tests/service_tests/test_domain.py 2020-03-15
22:16:41.000000000 +0100
@@ -102,6 +102,70 @@
ds.update_cookie.assert_called_with({"cookie": "value"})
i.service.setDnsEntries.assert_called_with('domain1', [dns_entry, ])
+ @patch('transip.client.SudsClient')
+ def test_add_dns_entries(self, mock_client):
+ ds = DomainService('sundayafternoon')
+ ds.build_cookie = Mock(return_value={'cookie': 'value'})
+ ds.update_cookie = Mock()
+ getinfo_result = Mock()
+ dns_entry1 = DnsEntry(
+ 'testentry1',
+ 86400,
+ DnsEntry.TYPE_A,
+ '127.0.0.1',
+ )
+ dns_entry2 = DnsEntry(
+ 'testentry2',
+ 86400,
+ DnsEntry.TYPE_A,
+ '127.0.0.1',
+ )
+ getinfo_result.dnsEntries = [
+ dns_entry1,
+ dns_entry2,
+ ]
+ mock_client.return_value.service.getInfo.return_value = getinfo_result
+ dns_entry3 = DnsEntry(
+ 'testentry3',
+ 86400,
+ DnsEntry.TYPE_A,
+ '127.0.0.1',
+ )
+ ds.add_dns_entries('domain1', [dns_entry3])
+ mock_client.return_value.service.setDnsEntries.assert_called_with(
+ 'domain1',
+ [dns_entry1, dns_entry2, dns_entry3],
+ )
+
+ @patch('transip.client.SudsClient')
+ def test_remove_dns_entries(self, mock_client):
+ ds = DomainService('sundayafternoon')
+ ds.build_cookie = Mock(return_value={'cookie': 'value'})
+ ds.update_cookie = Mock()
+ getinfo_result = Mock()
+ dns_entry1 = DnsEntry(
+ 'testentry1',
+ 86400,
+ DnsEntry.TYPE_A,
+ '127.0.0.1',
+ )
+ dns_entry2 = DnsEntry(
+ 'testentry2',
+ 86400,
+ DnsEntry.TYPE_A,
+ '127.0.0.1',
+ )
+ getinfo_result.dnsEntries = [
+ dns_entry1,
+ dns_entry2,
+ ]
+ mock_client.return_value.service.getInfo.return_value = getinfo_result
+ ds.remove_dns_entries('domain1', [dns_entry1])
+ mock_client.return_value.service.setDnsEntries.assert_called_with(
+ 'domain1',
+ [dns_entry2],
+ )
+
def test_batch_check_availability(self):
self._generic_test(
soap_method='batchCheckAvailability',
@@ -305,4 +369,4 @@
result='string',
parameters=('example.com',),
mode=MODE_RO
- )
\ No newline at end of file
+ )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/transip/__init__.py
new/transip-api-2.1.1/transip/__init__.py
--- old/transip-api-2.0.0/transip/__init__.py 2019-03-17 15:42:42.000000000
+0100
+++ new/transip-api-2.1.1/transip/__init__.py 2020-03-15 22:16:41.000000000
+0100
@@ -6,4 +6,4 @@
For usage of the API itself, please see https://www.transip.eu/transip/api/
"""
-__version__ = '2.0.0'
+__version__ = '2.1.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/transip/client.py
new/transip-api-2.1.1/transip/client.py
--- old/transip-api-2.0.0/transip/client.py 2019-03-17 15:42:42.000000000
+0100
+++ new/transip-api-2.1.1/transip/client.py 2020-03-15 22:16:41.000000000
+0100
@@ -17,6 +17,7 @@
from suds.client import Client as SudsClient
from suds.sudsobject import Object as SudsObject
from suds.xsd.doctor import Import, ImportDoctor
+from suds.plugin import DocumentPlugin
from . import __version__
@@ -52,6 +53,18 @@
return value
+class WSDLFixPlugin(DocumentPlugin):
+ # pylint: disable=W0232
+ """
+ A SudsFilter to fix wsdl document before it is parsed.
+ """
+
+ def loaded(self, context):
+ # pylint: disable=R0201
+ """
+ Replaces an invalid type in the wsdl document with a validy type.
+ """
+ context.document = context.document.replace(b'xsd:array',
b'soapenc:Array')
class Client(object):
"""
@@ -87,7 +100,7 @@
if suds_requests:
suds_kwargs['transport'] = suds_requests.RequestsTransport()
- self.soap_client = SudsClient(self.url, doctor=doc, **suds_kwargs)
+ self.soap_client = SudsClient(self.url, doctor=doc,
plugins=[WSDLFixPlugin()], **suds_kwargs)
def _sign(self, message):
""" Uses the decrypted private key to sign the message. """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/transip/service/domain.py
new/transip-api-2.1.1/transip/service/domain.py
--- old/transip-api-2.0.0/transip/service/domain.py 2019-03-17
15:42:42.000000000 +0100
+++ new/transip-api-2.1.1/transip/service/domain.py 2020-03-15
22:16:41.000000000 +0100
@@ -152,6 +152,29 @@
"""
return self._simple_request('setDnsEntries', domain_name, dns_entries,
mode=MODE_RW)
+ def add_dns_entries(self, domain_name, dns_entries):
+ """
+ Adds the given DnsEntries to the domain.
+ :type domain_name: str
+ :type dns_entries: list of transip.service.objects.DnsEntry
+ """
+ old_dns_entries = self.get_info(domain_name).dnsEntries
+ return self.set_dns_entries(domain_name, old_dns_entries + dns_entries)
+
+ def remove_dns_entries(self, domain_name, dns_entries):
+ """
+ Removes the given DnsEntries from the domain.
+ :type domain_name: str
+ :type dns_entries: list of transip.service.objects.DnsEntry to remove,
cannot be empty
+ """
+ if not dns_entries:
+ raise ValueError('dns_entries cannot be empty.')
+ old_dns_entries = self.get_info(domain_name).dnsEntries
+ # Remove the DNS entries from the existing DNS entries
+ for entry in dns_entries:
+ old_dns_entries.remove(entry)
+ return self.set_dns_entries(domain_name, old_dns_entries)
+
def set_owner(self, domain_name, registrant_whois_contact):
"""
Transip_DomainService::batchGetInfo
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/transip-api-2.0.0/transip/service/objects.py
new/transip-api-2.1.1/transip/service/objects.py
--- old/transip-api-2.0.0/transip/service/objects.py 2019-03-17
15:42:42.000000000 +0100
+++ new/transip-api-2.1.1/transip/service/objects.py 2020-03-15
22:16:41.000000000 +0100
@@ -50,7 +50,7 @@
def __eq__(self, other):
# other can be a list. This check ensures that other is a DnsEntry.
- if not hasattr(self, 'name') or not hasattr(self, 'type') or not
hasattr(self, 'content'):
+ if isinstance(other, list):
return False
# expire is intentionally not used for equality.