[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH 1/8] Add functions to go from an iScsiDiskDevice to an libiscsi node
- From: Hans de Goede <hdegoede redhat com>
- To: Discussion of Development and Customization of the Red Hat Linux Installer <anaconda-devel-list redhat com>
- Cc:
- Subject: [PATCH 1/8] Add functions to go from an iScsiDiskDevice to an libiscsi node
- Date: Fri, 31 Jul 2009 19:22:57 +0200
Add functions to go from an iScsiDiskDevice to an libiscsi node and the other
way around. This is a preparation patch for adding support for writing
the necessary dracut cmdline options to grub.conf
---
storage/iscsi.py | 30 +++++++++++++++++++++++-------
1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/storage/iscsi.py b/storage/iscsi.py
index cfe0c55..13ddc08 100644
--- a/storage/iscsi.py
+++ b/storage/iscsi.py
@@ -268,13 +268,10 @@ class iscsi(object):
# devices used for root get started by the initrd
if root.dependsOn(disk):
continue
- # find the iscsi node matching this disk
- for node in self.nodes:
- if node.name == disk.iscsi_name and \
- node.address == disk.iscsi_address and \
- node.port == disk.iscsi_port:
- node.setParameter("node.startup", "automatic")
- break
+
+ node = self.getNode(disk.iscsi_name, disk.iscsi_address, disk.iscsi_port)
+ if node:
+ node.setParameter("node.startup", "automatic")
if not os.path.isdir(instPath + "/etc/iscsi"):
os.makedirs(instPath + "/etc/iscsi", 0755)
@@ -289,4 +286,23 @@ class iscsi(object):
shutil.copytree("/var/lib/iscsi", instPath + "/var/lib/iscsi",
symlinks=True)
+ def getNode(self, name, address, port):
+ for node in self.nodes:
+ if node.name == name and node.address == address and \
+ node.port == port:
+ return node
+
+ return None
+
+ def getNodeDisks(self, node, storage):
+ nodeDisks = []
+ iscsiDisks = storage.devicetree.getDevicesByType("iscsi")
+ for disk in iscsiDisks:
+ if node.name == disk.iscsi_name and \
+ node.address == disk.iscsi_address and \
+ node.port == disk.iscsi_port:
+ nodeDisks.append(disk)
+
+ return nodeDisks
+
# vim:tw=78:ts=4:et:sw=4
--
1.6.2.2
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]