summaryrefslogtreecommitdiffstats
path: root/storage/__init__.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-04-16 16:01:57 -0400
committerChris Lumens <clumens@redhat.com>2009-05-12 11:34:04 -0400
commit2b5ce434500c5b7d53df3e0e9a286c9bb8181477 (patch)
treea923738cd2d5c0c657854d89610166612e6023c9 /storage/__init__.py
parent05c1c331d00bcb6c4b046b3aad7652c46b46e3a0 (diff)
downloadanaconda-2b5ce434500c5b7d53df3e0e9a286c9bb8181477.tar.gz
anaconda-2b5ce434500c5b7d53df3e0e9a286c9bb8181477.tar.xz
anaconda-2b5ce434500c5b7d53df3e0e9a286c9bb8181477.zip
Add support for --onpart, --ondrive, and --useexisting.
Diffstat (limited to 'storage/__init__.py')
-rw-r--r--storage/__init__.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/storage/__init__.py b/storage/__init__.py
index 6a56cdad3..b6184756d 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -949,6 +949,18 @@ class Storage(object):
self.zfcp.write(instPath)
def writeKS(self, f):
+ def useExisting(lst):
+ foundCreateDevice = False
+ foundCreateFormat = False
+
+ for l in lst:
+ if isinstance(l, ActionCreateDevice):
+ foundCreateDevice = True
+ elif isinstance(l, ActionCreateFormat):
+ foundCreateFormat = True
+
+ return (foundCreateFormat and not foundCreateDevice)
+
log.warning("Storage.writeKS not completely implemented")
f.write("# The following is the partition information you requested\n")
f.write("# Note that any partitions you deleted are not expressed\n")
@@ -991,7 +1003,7 @@ class Storage(object):
for path in ordering:
for device in map(lambda x: x.device, dict[path]):
- device.writeKS(f)
+ device.writeKS(f, preexisting=useExisting(dict[path]))
f.write("\n")
self.iscsi.writeKS(f)