7082775 Manifest parser should fail if partition name not specified
authorMatt Keenan <matt.keenan@oracle.com>
Wed, 31 Aug 2011 17:48:08 +0100
changeset 1438 30d10e4731d5
parent 1437 4d1bbd9d1aa4
child 1439 7375801f1f12
7082775 Manifest parser should fail if partition name not specified
usr/src/lib/install_target/physical.py
--- a/usr/src/lib/install_target/physical.py	Wed Aug 31 08:40:53 2011 -0700
+++ b/usr/src/lib/install_target/physical.py	Wed Aug 31 17:48:08 2011 +0100
@@ -129,6 +129,13 @@
         # If the user specifies a name of "", turn it into a None
         if name is not None and len(name) == 0:
             name = None
+
+        if name is None and action != "use_existing_solaris2":
+            # Partition name must be provided in all cases other than
+            # use_existing_solaris2
+            raise ParsingError("Partition name must be provided if action "
+                               "is not 'use_existing_solaris2'")
+
         partition = Partition(name, validate_children=False)
 
         size = element.find("size")