[PATCH rhel7-branch 1/2] iscsi: when logging into nodes consider ip:port of node (#1114820)
Radek Vykydal
rvykydal at redhat.com
Tue Dec 2 08:52:55 UTC 2014
Resolves: rhbz#1114820
Discovery on an ip address can return multipath targets accessible via multiple
addresses. Take it into account when iterating list of nodes for login.
---
pyanaconda/ui/gui/spokes/advstorage/iscsi.glade | 2 ++
pyanaconda/ui/gui/spokes/advstorage/iscsi.py | 8 +++++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
index f431385..e5141b4 100644
--- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
+++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.glade
@@ -1271,6 +1271,8 @@
<column type="gchararray"/>
<!-- column-name nodeIface -->
<column type="gchararray"/>
+ <!-- column-name nodePortal -->
+ <column type="gchararray"/>
</columns>
</object>
<object class="GtkTreeModelFilter" id="nodeStoreFiltered">
diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
index 8b21409..ed20d31 100644
--- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
+++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py
@@ -41,7 +41,7 @@ Credentials = namedtuple("Credentials", ["style",
"targetIP", "initiator", "username",
"password", "rUsername", "rPassword"])
-NodeStoreRow = namedtuple("NodeStoreRow", ["selected", "notLoggedIn", "name", "iface"])
+NodeStoreRow = namedtuple("NodeStoreRow", ["selected", "notLoggedIn", "name", "iface", "portal"])
def discover_no_credentials(builder):
return Credentials(STYLE_NONE,
@@ -319,7 +319,8 @@ class ISCSIDialog(GUIObject):
def _add_nodes(self, nodes):
for node in nodes:
iface = self.iscsi.ifaces.get(node.iface, node.iface)
- self._store.append([False, True, node.name, iface])
+ portal = "%s:%s" % (node.address, node.port)
+ self._store.append([False, True, node.name, iface, portal])
# We should select the first node by default.
self._store[0][0] = True
@@ -350,7 +351,8 @@ class ISCSIDialog(GUIObject):
log.debug("DBG _login _discoveredNodes: %s" % [str(n) for n in self._discoveredNodes])
for node in self._discoveredNodes:
- if obj.notLoggedIn and node.name == obj.name:
+ if obj.notLoggedIn and node.name == obj.name \
+ and obj.portal == "%s:%s" % (node.address, node.port):
# when binding interfaces match also interface
if self.iscsi.ifaces and \
obj.iface != self.iscsi.ifaces[node.iface]:
--
1.9.3
More information about the anaconda-patches
mailing list