summaryrefslogtreecommitdiffstats
path: root/instdata.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-09-19 14:48:22 -0400
committerChris Lumens <clumens@redhat.com>2008-09-19 14:48:22 -0400
commit651e5d5d63bfc2154e0cc4548486af71e7b5b6e0 (patch)
tree206c9cd75161e21261fc200a2279aec961f5f8c6 /instdata.py
parentd9e7b552057015d3bbb5326ae82dbddcf7854c13 (diff)
downloadanaconda-651e5d5d63bfc2154e0cc4548486af71e7b5b6e0.tar.gz
anaconda-651e5d5d63bfc2154e0cc4548486af71e7b5b6e0.tar.xz
anaconda-651e5d5d63bfc2154e0cc4548486af71e7b5b6e0.zip
Don't worry about errors looking up protected partitions on upgrades.
This mostly affects preupgrade, where the repo (and therefore what's passed in as the methodstr) can be a UUID for a logical volume. At this point, lvm is not activated so looking up the device matching the UUID will of course fail. That's not really an error on the upgrade case since we won't be formatting any partitions. On the installation case, this is an error. And keeping it an error here means we continue not allowing HDISO installs from an LV or RAID volume.
Diffstat (limited to 'instdata.py')
-rw-r--r--instdata.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/instdata.py b/instdata.py
index 20af5c9ad..135d51eac 100644
--- a/instdata.py
+++ b/instdata.py
@@ -18,9 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Author(s): Erik Troan <ewt@redhat.com>
+# Chris Lumens <clumens@redhat.com>
#
-import os
+import os, sys
import stat
import string
import language
@@ -104,14 +105,27 @@ class InstallData:
device = method.split(":", 3)[0]
if device.startswith("LABEL="):
- device = isys.getDeviceByToken("LABEL", device[6:])
+ dev = isys.getDeviceByToken("LABEL", device[6:])
elif device.startswith("UUID="):
- device = isys.getDeviceByToken("UUID", device[5:])
+ dev = isys.getDeviceByToken("UUID", device[5:])
+ else:
+ dev = device
+
+ if dev is None:
+ if self.getUpgrade():
+ return
+ else:
+ self.anaconda.intf.messageWindow(_("Unknown Device"),
+ _("The installation source given by device %s "
+ "could not be found. Please check your "
+ "parameters and try again.") % device,
+ type="custom", custom_buttons = [_("_Exit installer")])
+ sys.exit(1)
- if device.startswith("/dev/"):
- device = device[5:]
+ if dev.startswith("/dev/"):
+ dev = dev[5:]
- self.partitions.protected = [device]
+ self.partitions.protected = [dev]
def setInstallProgressClass(self, c):
self.instProgress = c