File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
sdbus_async/networkmanager
sdbus_block/networkmanager Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ def __init__(self, bus: Optional[SdBus] = None) -> None:
159
159
NETWORK_MANAGER_SERVICE_NAME ,
160
160
'/org/freedesktop/NetworkManager/Settings' ,
161
161
bus )
162
+ self ._nm_used_bus = bus
162
163
163
164
async def get_connections_by_id (self , connection_id : str ) -> List [str ]:
164
165
"""Helper method to get a list of connection profile paths
@@ -171,7 +172,7 @@ async def get_connections_by_id(self, connection_id: str) -> List[str]:
171
172
connection_paths_with_matching_id = []
172
173
connection_paths : List [str ] = await self .connections
173
174
for connection_path in connection_paths :
174
- settings = NetworkConnectionSettings (connection_path )
175
+ settings = NetworkConnectionSettings (connection_path , self . _nm_used_bus )
175
176
settings_properites = await settings .get_settings ()
176
177
# settings_properites["connection"]["id"][1] gives the id value:
177
178
if settings_properites ["connection" ]["id" ][1 ] == connection_id :
Original file line number Diff line number Diff line change @@ -154,6 +154,7 @@ def __init__(self, bus: Optional[SdBus] = None) -> None:
154
154
NETWORK_MANAGER_SERVICE_NAME ,
155
155
'/org/freedesktop/NetworkManager/Settings' ,
156
156
bus )
157
+ self ._nm_used_bus = bus
157
158
158
159
def get_connections_by_id (self , connection_id : str ) -> List [str ]:
159
160
"""Helper method to get a list of connection profile paths
@@ -165,7 +166,7 @@ def get_connections_by_id(self, connection_id: str) -> List[str]:
165
166
"""
166
167
connection_paths_with_matching_id = []
167
168
for connection_path in self .connections :
168
- profile = NetworkConnectionSettings (connection_path )
169
+ profile = NetworkConnectionSettings (connection_path , self . _nm_used_bus )
169
170
# profile.get_settings()["connection"]["id"][1] gives the id value:
170
171
if profile .get_settings ()["connection" ]["id" ][1 ] == connection_id :
171
172
connection_paths_with_matching_id .append (connection_path )
You can’t perform that action at this time.
0 commit comments