commit python-proton-vpn-network-manager for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-proton-vpn-network-manager for openSUSE:Factory checked in at 2024-03-25 21:13:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-proton-vpn-network-manager (Old) and /work/SRC/openSUSE:Factory/.python-proton-vpn-network-manager.new.1905 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-proton-vpn-network-manager" Mon Mar 25 21:13:11 2024 rev:2 rq:1161443 version:0.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-proton-vpn-network-manager/python-proton-vpn-network-manager.changes 2024-03-21 17:00:38.400819985 +0100 +++ /work/SRC/openSUSE:Factory/.python-proton-vpn-network-manager.new.1905/python-proton-vpn-network-manager.changes 2024-03-25 21:20:26.388397665 +0100 @@ -1,0 +2,11 @@ +Mon Mar 25 14:54:43 UTC 2024 - Dirk Müller <dmueller@suse.com> + +- update to 0.4.0: + * Initialize connection with persisted parameters + +------------------------------------------------------------------- +Thu Mar 21 15:13:08 UTC 2024 - Alexandre Vicenzi <alexandre.vicenzi@suse.com> + +- Add missing dependency PyCairo and pytest-asyncio + +------------------------------------------------------------------- Old: ---- v0.3.3.tar.gz New: ---- v0.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-proton-vpn-network-manager.spec ++++++ --- /var/tmp/diff_new_pack.zje5QQ/_old 2024-03-25 21:20:28.396471519 +0100 +++ /var/tmp/diff_new_pack.zje5QQ/_new 2024-03-25 21:20:28.408471960 +0100 @@ -19,7 +19,7 @@ %define skip_python2 1 %{?sle15_python_module_pythons} Name: python-proton-vpn-network-manager -Version: 0.3.3 +Version: 0.4.0 Release: 0 Summary: Proton VPN library for NetworkManager License: GPL-3.0-or-later @@ -30,6 +30,8 @@ BuildRequires: %{python_module pip} BuildRequires: %{python_module proton-core} BuildRequires: %{python_module proton-vpn-connection} +BuildRequires: %{python_module pycairo} +BuildRequires: %{python_module pytest-asyncio} BuildRequires: %{python_module pytest-cov} BuildRequires: %{python_module pytest} BuildRequires: %{python_module wheel} @@ -41,6 +43,7 @@ Requires: python-gobject Requires: python-proton-core Requires: python-proton-vpn-connection +Requires: python-pycairo Conflicts: python-protonvpn-nm-lib BuildArch: noarch %python_subpackages @@ -59,7 +62,9 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest tests +# test case is broken +# https://github.com/ProtonVPN/python-proton-vpn-network-manager/issues/2 +%pytest tests --deselect="tests/test_networkmanager.py::test_initialize_persisted_connection_determines_initial_connection_state" %files %{python_files} %license LICENSE ++++++ v0.3.3.tar.gz -> v0.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-proton-vpn-network-manager-0.3.3/debian/changelog new/python-proton-vpn-network-manager-0.4.0/debian/changelog --- old/python-proton-vpn-network-manager-0.3.3/debian/changelog 2024-01-15 16:13:25.000000000 +0100 +++ new/python-proton-vpn-network-manager-0.4.0/debian/changelog 2024-02-14 15:52:48.000000000 +0100 @@ -1,3 +1,21 @@ +protonvpn-network-manager (0.4.0) unstable; urgency=medium + + * Initialize connection with persisted parameters + + -- Josep Llaneras <josep.llaneras@proton.ch> Wed, 14 Feb 2024 15:52:01 +0100 + +protonvpn-network-manager (0.3.5) unstable; urgency=medium + + * Remove connection delay + + -- Josep Llaneras <josep.llaneras@proton.ch> Wed, 31 Jan 2024 12:06:35 +0100 + +protonvpn-network-manager (0.3.4) unstable; urgency=medium + + * Initialize state machine in Error state when inactive VPN connection is found + + -- Josep Llaneras <josep.llaneras@proton.ch> Wed, 31 Jan 2024 10:05:47 +0100 + protonvpn-network-manager (0.3.3) unstable; urgency=medium * Fix deadlock when notifying connection subscribers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-proton-vpn-network-manager-0.3.3/proton/vpn/backend/linux/networkmanager/core/networkmanager.py new/python-proton-vpn-network-manager-0.4.0/proton/vpn/backend/linux/networkmanager/core/networkmanager.py --- old/python-proton-vpn-network-manager-0.3.3/proton/vpn/backend/linux/networkmanager/core/networkmanager.py 2024-01-15 16:13:25.000000000 +0100 +++ new/python-proton-vpn-network-manager-0.4.0/proton/vpn/backend/linux/networkmanager/core/networkmanager.py 2024-02-14 15:52:48.000000000 +0100 @@ -286,29 +286,39 @@ all_protocols = Loader.get_all(LinuxNetworkManager.backend) for protocol in all_protocols: if protocol.cls.protocol == persisted_parameters.protocol: - vpn_connection = protocol.cls( - server=None, credentials=None, persisted_parameters=persisted_parameters + vpn_connection = protocol.cls.from_persistence( + persisted_parameters ) - if isinstance(vpn_connection.initial_state, states.Connected): + if not isinstance(vpn_connection.initial_state, states.Disconnected): return vpn_connection return None def _initialize_persisted_connection( - self, persisted_parameters: ConnectionParameters + self, connection_id: str ) -> states.State: """Abstract method implementation.""" + context = StateContext( + event=events.Initialized(EventContext(connection=self)), + connection=self + ) active_connection = self.nm_client.get_active_connection( - persisted_parameters.connection_id + connection_id ) if active_connection: active_connection.connect( "vpn-state-changed", self._on_vpn_state_changed ) - return states.Connected(StateContext(connection=self)) + return states.Connected(context) + + inactive_connection = self.nm_client.get_connection(connection_id) + if inactive_connection: + # If the connection is inactive then it means that it unexpectedly dropped. + # Note that when the user willingly disconnects then the VPN connection is discarded. + return states.Error(context) - return states.Disconnected(StateContext(connection=self)) + return states.Disconnected(context) def _get_servername(self) -> "str": server_name = self._vpnserver.server_name or "Connection" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-proton-vpn-network-manager-0.3.3/proton/vpn/backend/linux/networkmanager/core/tcpcheck.py new/python-proton-vpn-network-manager-0.4.0/proton/vpn/backend/linux/networkmanager/core/tcpcheck.py --- old/python-proton-vpn-network-manager-0.3.3/proton/vpn/backend/linux/networkmanager/core/tcpcheck.py 2024-01-15 16:13:25.000000000 +0100 +++ new/python-proton-vpn-network-manager-0.4.0/proton/vpn/backend/linux/networkmanager/core/tcpcheck.py 2024-02-14 15:52:48.000000000 +0100 @@ -70,8 +70,6 @@ async def _is_port_reachable(port): return await loop.run_in_executor(None, is_port_reachable, ip_address, port, timeout) - # FIXME: get rid of this sleep. # pylint: disable=fixme - await asyncio.sleep(2) tasks = [ asyncio.create_task(_is_port_reachable(port)) for port in ports diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-proton-vpn-network-manager-0.3.3/rpmbuild/SPECS/package.spec new/python-proton-vpn-network-manager-0.4.0/rpmbuild/SPECS/package.spec --- old/python-proton-vpn-network-manager-0.3.3/rpmbuild/SPECS/package.spec 2024-01-15 16:13:25.000000000 +0100 +++ new/python-proton-vpn-network-manager-0.4.0/rpmbuild/SPECS/package.spec 2024-02-14 15:52:48.000000000 +0100 @@ -1,5 +1,5 @@ %define unmangled_name proton-vpn-network-manager -%define version 0.3.3 +%define version 0.4.0 %define release 1 Prefix: %{_prefix} @@ -55,6 +55,15 @@ %defattr(-,root,root) %changelog +* Wed Feb 14 2024 Josep Llaneras <josep.llaneras@proton.ch> 0.4.0 +- Initialize connection with persisted parameters + +* Wed Jan 31 2024 Josep Llaneras <josep.llaneras@proton.ch> 0.3.5 +- Remove connection delay + +* Wed Jan 31 2024 Josep Llaneras <josep.llaneras@proton.ch> 0.3.4 +- Initialize state machine in Error state when inactive VPN connection is found + * Thu Jan 11 2024 Josep Llaneras <josep.llaneras@proton.ch> 0.3.3 - Fix deadlock when notifying connection subscribers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-proton-vpn-network-manager-0.3.3/setup.py new/python-proton-vpn-network-manager-0.4.0/setup.py --- old/python-proton-vpn-network-manager-0.3.3/setup.py 2024-01-15 16:13:25.000000000 +0100 +++ new/python-proton-vpn-network-manager-0.4.0/setup.py 2024-02-14 15:52:48.000000000 +0100 @@ -4,7 +4,7 @@ setup( name="proton-vpn-network-manager", - version="0.3.3", + version="0.4.0", description="Proton Technologies VPN connector for linux", author="Proton Technologies", author_email="contact@protonmail.com", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-proton-vpn-network-manager-0.3.3/tests/test_networkmanager.py new/python-proton-vpn-network-manager-0.4.0/tests/test_networkmanager.py --- old/python-proton-vpn-network-manager-0.3.3/tests/test_networkmanager.py 2024-01-15 16:13:25.000000000 +0100 +++ new/python-proton-vpn-network-manager-0.4.0/tests/test_networkmanager.py 2024-02-14 15:52:48.000000000 +0100 @@ -281,20 +281,27 @@ @pytest.mark.asyncio @pytest.mark.parametrize( - "nm_connection, expected_state", + "active_nm_connection, inactive_nm_connection, expected_state", [ ( Mock(), - states.Connected, # When there is an existing connection the initial state is connected. + None, + states.Connected, # When there is an active connection the initial state is connected. ), ( None, + None, states.Disconnected # When there is not a connection, the initial state is disconnected. ), + ( + None, + Mock(), + states.Error # When there is an inactive connection, the initial state is Error. + ), ] ) async def test_initialize_persisted_connection_determines_initial_connection_state( - nm_connection, expected_state + active_nm_connection, inactive_nm_connection, expected_state ): persisted_parameters = ConnectionParameters( connection_id="connection-id", @@ -305,7 +312,8 @@ server_name="server-name" ) nm_client_mock = Mock() - nm_client_mock.get_active_connection.return_value = nm_connection + nm_client_mock.get_active_connection.return_value = active_nm_connection + nm_client_mock.get_connection.return_value = inactive_nm_connection # The VPNConnection constructor calls `_initialize_persisted_connection` # when `persisted_parameters` are provided.
participants (1)
-
Source-Sync