FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 04-19-2011, 04:34 PM
David Lehman
 
Default Allow unsetting of stage1_device.

Also handle trying to set a default stage1 device when there are no
valid candidate devices.
---
pyanaconda/bootloader.py | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 791b1fc..79659a5 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -275,18 +275,25 @@ class BootLoader(object):
def stage1_device(self):
""" Stage1 target device. """
if not self._stage1_device:
- self.stage1_device = self.stage1_devices[0]
+ log.debug("no stage1 device: %s" % self.stage1_devices)
+ try:
+ self.stage1_device = self.stage1_devices[0]
+ except IndexError:
+ pass

return self._stage1_device

@stage1_device.setter
def stage1_device(self, device):
- if not self._is_valid_stage1_device(device):
+ if device and not self._is_valid_stage1_device(device):
raise ValueError("%s is not a valid stage1 device" % device.name)

- log.debug("new bootloader stage1 device: %s" % device.name)
+ log.debug("new bootloader stage1 device: %s" % getattr(device,
+ "name", None))
self._stage1_device = device
- self.stage1_drive = device.disks[0]
+ if device:
+ self.stage1_drive = device.disks[0]
+

@property
def stage2_device(self):
--
1.7.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-19-2011, 09:46 PM
David Cantrell
 
Default Allow unsetting of stage1_device.

Ack.

David Lehman <dlehman@redhat.com> wrote:

> Also handle trying to set a default stage1 device when there are no
> valid candidate devices.
> ---
> pyanaconda/bootloader.py | 15 +++++++++++----
> 1 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
> index 791b1fc..79659a5 100644
> --- a/pyanaconda/bootloader.py
> +++ b/pyanaconda/bootloader.py
> @@ -275,18 +275,25 @@ class BootLoader(object):
> def stage1_device(self):
> """ Stage1 target device. """
> if not self._stage1_device:
> - self.stage1_device = self.stage1_devices[0]
> + log.debug("no stage1 device: %s" % self.stage1_devices)
> + try:
> + self.stage1_device = self.stage1_devices[0]
> + except IndexError:
> + pass
>
> return self._stage1_device
>
> @stage1_device.setter
> def stage1_device(self, device):
> - if not self._is_valid_stage1_device(device):
> + if device and not self._is_valid_stage1_device(device):
> raise ValueError("%s is not a valid stage1 device" % device.name)
>
> - log.debug("new bootloader stage1 device: %s" % device.name)
> + log.debug("new bootloader stage1 device: %s" % getattr(device,
> + "name", None))
> self._stage1_device = device
> - self.stage1_drive = device.disks[0]
> + if device:
> + self.stage1_drive = device.disks[0]
> +
>
> @property
> def stage2_device(self):
> --
> 1.7.3.4
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

--
David Cantrell <dcantrell@redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Seattle, WA | UTC-7

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 01:21 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org