[PATCH 6/7] netlist.py: remove the forth 'None' return in get_network_selection()

Daniel Henrique Barboza danielhb413 at gmail.com
Tue Jun 2 20:39:37 UTC 2020

Commit v2.2.1-200-g4c3c53f7 ("virtManager: Remove network portgroup
UI") removed 'portgroup', the forth value of the returned tuple in
get_network_selection(), and all related code that was using this
forth value.

That change forgot to change the line where, if no rows are found, a
tuple with "None" values is returned. The "None" tuple is still
returning 4 "None" values. Since no remaining code is checking for
a forth value, this is benign and has no impact in the logic.

'pylint' does not seem to care though, and it is complaining about
'unbalanced-tuple-unpacking' because, in the condition mentioned above,
a forth "None" value is returned and no one is bothering checking for

Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
 virtManager/device/netlist.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virtManager/device/netlist.py b/virtManager/device/netlist.py
index 2b53dda9..0e70b6d4 100644
--- a/virtManager/device/netlist.py
+++ b/virtManager/device/netlist.py
@@ -267,7 +267,7 @@ class vmmNetworkList(vmmGObjectUI):
     def get_network_selection(self):
         row = self._get_network_row()
         if not row:
-            return None, None, None, None
+            return None, None, None
         net_type = row[NET_ROW_TYPE]
         net_src = row[NET_ROW_SOURCE]

More information about the virt-tools-list mailing list