[virt-manager PATCH 4/4] pep8 E731: do not assign a lambda expression, use a def

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

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 virtManager/domain.py   | 3 ++-
 virtinst/pollhelpers.py | 9 ++++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/virtManager/domain.py b/virtManager/domain.py
index bb8c511..f3f21e8 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -257,7 +257,8 @@ class vmmDomain(vmmLibvirtObject):
 
     @staticmethod
     def pretty_status_reason(status, reason):
-        key = lambda x, y: getattr(libvirt, "VIR_DOMAIN_" + x, y)
+        def key(x, y):
+            return getattr(libvirt, "VIR_DOMAIN_" + x, y)
         reasons = {
             libvirt.VIR_DOMAIN_RUNNING : {
                 key("RUNNING_BOOTED", 1) : _("Booted"),
diff --git a/virtinst/pollhelpers.py b/virtinst/pollhelpers.py
index dafd079..d4acc30 100644
--- a/virtinst/pollhelpers.py
+++ b/virtinst/pollhelpers.py
@@ -153,7 +153,8 @@ def fetch_volumes(backend, pool, origmap, build_func):
                                 pool.listAllVolumes, build_func)
     else:
         active_list = pool.listVolumes
-        inactive_list = lambda: []
+        def inactive_list():
+            return []
         lookup_func = pool.storageVolLookupByName
         return _old_poll_helper(origmap, name,
                                 active_list, inactive_list,
@@ -184,8 +185,10 @@ def fetch_nodedevs(backend, origmap, build_func):
         return _new_poll_helper(origmap, name,
                                 backend.listAllDevices, build_func)
     else:
-        active_list = lambda: backend.listDevices(None, 0)
-        inactive_list = lambda: []
+        def active_list():
+            return backend.listDevices(None, 0)
+        def inactive_list():
+            return []
         lookup_func = backend.nodeDeviceLookupByName
         return _old_poll_helper(origmap, name,
                                 active_list, inactive_list,
-- 
2.4.5

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[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