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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Pino Toscano <ptoscano@xxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux