[virt-manager PATCH 04/21] i18n: simplify vmmAddHardware.controller_pretty_desc

Pino Toscano ptoscano at redhat.com
Mon Jul 13 08:25:42 UTC 2020


Shortcut the specific cases, avoiding string puzzles; keep using
vmmAddHardware.controller_pretty_type() otherwise.

Signed-off-by: Pino Toscano <ptoscano at redhat.com>
---
 virtManager/addhardware.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 094cdc7c..b5e166c0 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -481,13 +481,13 @@ class vmmAddHardware(vmmGObjectUI):
 
     @staticmethod
     def controller_pretty_desc(dev):
-        ret = vmmAddHardware.controller_pretty_type(dev.type)
-        if dev.type == "scsi":
+        if dev.type == DeviceController.TYPE_SCSI:
             if dev.model == "virtio-scsi":
-                ret = "Virtio " + ret
-        if dev.type == "pci" and dev.model == "pcie-root":
-            ret = _("PCIe")
-        return ret
+                return _("VirtIO SCSI")
+        if dev.type == DeviceController.TYPE_PCI:
+            if dev.model == "pcie-root":
+                return _("PCIe")
+        return vmmAddHardware.controller_pretty_type(dev.type)
 
     @staticmethod
     def disk_old_recommended_buses(guest):
-- 
2.26.2




More information about the virt-tools-list mailing list