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 > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 03-26-2010, 02:29 PM
Chris Lumens
 
Default Turn protected devices into a property on the Anaconda object.

This is needed so I can avoid duplicating the logic of what is and is not
a protected device in the filtering UI.
---
anaconda | 13 +++++++++++++
storage/__init__.py | 13 +++----------
2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/anaconda b/anaconda
index f613618..051466f 100755
--- a/anaconda
+++ b/anaconda
@@ -549,6 +549,19 @@ class Anaconda(object):
return self._platform

@property
+ def protected(self):
+ import stat
+
+ if os.path.exists("/dev/live") and
+ stat.S_ISBLK(os.stat("/dev/live")[stat.ST_MODE]):
+ return [os.readlink("/dev/live")]
+ elif self.methodstr and self.methodstr.startswith("hd:"):
+ method = self.methodstr[3:]
+ return [method.split(":", 3)[0]]
+ else:
+ return []
+
+ @property
def users(self):
if not self._users:
import users
diff --git a/storage/__init__.py b/storage/__init__.py
index 4e3bbf7..52ff543 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -85,18 +85,11 @@ def storageInitialize(anaconda):
anaconda.intf.resetReinitInconsistentLVMQuestion()

# Set up the protected partitions list now.
- if os.path.exists("/dev/live") and
- stat.S_ISBLK(os.stat("/dev/live")[stat.ST_MODE]):
- target = os.readlink("/dev/live")
- storage.protectedDevSpecs = [target]
- storage.reset()
- elif anaconda.methodstr and anaconda.methodstr.startswith("hd:"):
- method = anaconda.methodstr[3:]
- devspec = method.split(":", 3)[0]
- storage.protectedDevSpecs.append(devspec)
+ if anaconda.protected:
+ storage.protectedDevSpecs.extend(anaconda.protecte d)
storage.reset()

- if not storage.protectedDevices:
+ if not flags.livecdInstall and not storage.protectedDevices:
if anaconda.upgrade:
return
else:
--
1.6.5.1

_______________________________________________
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 05:50 PM.

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