Skip to content

Commit b5cc067

Browse files
committed
Added reapply_profile method to device interface
Tries to update device configuration using the profile object.
1 parent cb3839a commit b5cc067

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

sdbus_async/networkmanager/interfaces_devices.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,22 @@ async def get_applied_connection_profile(
10411041

10421042
return ConnectionProfile.from_dbus(connection_vardict), version_id
10431043

1044+
async def reapply_profile(
1045+
self,
1046+
profile: ConnectionProfile,
1047+
version_id: int = 0,
1048+
) -> None:
1049+
"""Attempts to update the configuration of a device
1050+
without deactivating it.
1051+
1052+
:param ConnectionProfile profile: Connection profile to update
1053+
with.
1054+
:param int version_id: If non-zero, the current version id of
1055+
the applied-connection must match. The current version id can be
1056+
retrieved via :py:meth:`get_applied_connection_profile`.
1057+
"""
1058+
await self.reapply(profile.to_dbus(), version_id, 0)
1059+
10441060

10451061
class NetworkManagerPPPInterfaceAsync(
10461062
DbusInterfaceCommonAsync,

sdbus_block/networkmanager/interfaces_devices.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,22 @@ def get_applied_connection_profile(
10061006

10071007
return ConnectionProfile.from_dbus(connection_vardict), version_id
10081008

1009+
def reapply_profile(
1010+
self,
1011+
profile: ConnectionProfile,
1012+
version_id: int = 0,
1013+
) -> None:
1014+
"""Attempts to update the configuration of a device
1015+
without deactivating it.
1016+
1017+
:param ConnectionProfile profile: Connection profile to update
1018+
with.
1019+
:param int version_id: If non-zero, the current version id of
1020+
the applied-connection must match. The current version id can be
1021+
retrieved via :py:meth:`get_applied_connection_profile`.
1022+
"""
1023+
self.reapply(profile.to_dbus(), version_id, 0)
1024+
10091025

10101026
class NetworkManagerPPPInterface(
10111027
DbusInterfaceCommon,

0 commit comments

Comments
 (0)