On 02/28/2012 07:39 PM, David Cantrell wrote:
Ack, with comments.
On Tue, Feb 28, 2012 at 12:03:29PM +0100, Radek Vykydal wrote:
-
- def usedByISCSI(self, anaconda):
- import storage
- for d in anaconda.id.storage.devices:
- if (isinstance(d, storage.devices.NetworkStorageDevice) and
- d.host_address):
- if self.iface == ifaceForHostIP(d.host_address):
- return True
+ if d.nic:
+ if self.iface == d.nic:
+ return True
This could be reduced to:
if d.nic and self.iface == d.nic:
return True
You may have overlooked that the block is in a loop,
so the behaviour for:
bool(d.nic) = True
self.iface != d.nic
self.iface == ifaceForHostIP(d.host_address)
from doing next cycle to returning True
+ else:
+ if self.iface == ifaceForHostIP(d.host_address):
+ return True
These could just be merged to an elif line.
sure, I found it expressing what it should represent more
clearly this way, perhaps this would be more clear:
# device bound to interface
if d.nic:
if self.iface == d.nic:
return True
# device using default interface
else:
if self.iface == ifaceForHostIP(d.host_address):
return True
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list