Change in vdsm[master]: make the promisc property compliant with old pyflakes

asegurap at redhat.com asegurap at redhat.com
Fri Sep 19 10:07:48 UTC 2014


Antoni Segura Puimedon has uploaded a new change for review.

Change subject: make the promisc property compliant with old pyflakes
......................................................................

make the promisc property compliant with old pyflakes

el6 pyflakes is older than the addition of setters and deleters for
python class properties. Thus, it wrongly detects the syntax:

    @x.setter
    def x(self, value)

As a redefinition of x. Thankfully, it is possible to use
the property builtin to achieve the same result without being
flagged as re-defining.

Change-Id: Ib44e44f12e15f6613cb9c841dc11938ab0ce9755
Bug-Url: https://bugzilla.redhat.com/1134851
Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
---
M lib/vdsm/ipwrapper.py
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/33071/1

diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index c2bbdd8..e00ed56 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -245,12 +245,10 @@
     def oper_up(self):
         return bool(self.flags & self.IFF_RUNNING)
 
-    @property
-    def promisc(self):
+    def get_promisc(self):
         return bool(self.flags & self.IFF_PROMISC)
 
-    @promisc.setter
-    def promisc(self, value):
+    def set_promisc(self, value):
         """Takes a boolean to enable/disable Link promiscuity"""
         if value:
             self.flags |= self.IFF_PROMISC
@@ -258,6 +256,8 @@
             self.flags &= ~self.IFF_PROMISC
         self.set_flags(self.flags)
 
+    promisc = property(get_promisc, set_promisc, None, 'Link promiscuity flag')
+
     def set_flags(self, flags):
         "Set device flags. We need this local definition until ethtool has it"
 


-- 
To view, visit http://gerrit.ovirt.org/33071
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib44e44f12e15f6613cb9c841dc11938ab0ce9755
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>


More information about the vdsm-patches mailing list