When there was another iface up (beside ibftX device activated due to ip=ibft boot option) which could be used to access iscsi target configured in iBFT, this device was set to be used in initramfs with ip= option (eg ip=ens3:dhcp) while ip=ibft should have been set.
Resolves: rhbz#1077291
From: Radek Vykydal rvykydal@redhat.com
When there was another iface up (beside ibftX device activated due to ip=ibft boot option) which could be used to access iscsi target configured in iBFT, this device was set to be used in initramfs with ip= option (eg ip=ens3:dhcp) while ip=ibft should have been set.
Resolves: rhbz#1077291 --- pyanaconda/network.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/network.py b/pyanaconda/network.py index 977417c..31c06a3 100644 --- a/pyanaconda/network.py +++ b/pyanaconda/network.py @@ -292,7 +292,10 @@ def dumpMissingDefaultIfcfgs(): def dracutSetupArgs(networkStorageDevice):
if networkStorageDevice.nic == "default" or ":" in networkStorageDevice.nic: - nic = ifaceForHostIP(networkStorageDevice.host_address) + if getattr(networkStorageDevice, 'ibft', False): + nic = ibftIface() + else: + nic = ifaceForHostIP(networkStorageDevice.host_address) if not nic: return "" else: @@ -943,6 +946,13 @@ def get_team_slaves(master_specs):
return slaves
+def ibftIface(): + iface = "" + ipopt = flags.cmdline.get('ip') + if ipopt and ipopt.startswith('ibft'): + iface = ipopt.split(":")[0] + return iface + def ifaceForHostIP(host): route = iutil.execWithCapture("ip", [ "route", "get", "to", host ]) if not route: @@ -1118,7 +1128,11 @@ def usedByRootOnISCSI(iface, storage): if (isinstance(d, iScsiDiskDevice) and rootdev.dependsOn(d)): if d.nic == "default" or ":" in d.nic: - if iface == ifaceForHostIP(d.host_address): + if getattr(d, 'ibft', False): + deviface = ibftIface() + else: + deviface = ifaceForHostIP(d.host_address) + if iface == deviface: return True elif d.nic == iface: return True
Added label: rhel7-branch.
Looks good to me.
Added label: ACK.
Closed.
pushed
anaconda-patches@lists.fedorahosted.org