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

Re: [PATCH rhel6-branch 1/7] iscsi: add iface binding support to discovery and setup GUI (#500273)



On 02/28/2012 07:31 PM, David Cantrell wrote:
Ack, with comments below.

On Tue, Feb 28, 2012 at 12:03:28PM +0100, Radek Vykydal wrote:

+    # This will modify behaviour of iscsi.discovery() function
+    if storage.iscsi.iscsi().mode == "none" and not bind:
+        storage.iscsi.iscsi().delete_interfaces()
+    elif (storage.iscsi.iscsi().mode == "none" and bind
+          or storage.iscsi.iscsi().mode == "bind"):
I'm not liking how this reads.  I can read it as:

     elif (storage.iscsi.iscsi().mode == "none" and bind) or \
          storage.iscsi.iscsi().mode == "bind"

or:

     elif storage.iscsi.iscsi().mode == "none" and \
          (storage.iscsi.iscsi().mode == "bind" or bind)

I say it needs better parens for readability.

I'll add parens.


+    def _getMode(self):
+        if not self.active_nodes():
+            return "none"
+        else:
+            if self.ifaces:
+                return "bind"
+            else:
+                return "default"
This if/else block doesn't really need to be in an else block by itself.

Sure, I'll fix it.


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