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 > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 03-20-2008, 04:25 PM
David Lehman
 
Default Put in some handling for redundant method calls and devices containing '/'.

---
cryptodev.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/cryptodev.py b/cryptodev.py
index 2cd14d7..080d198 100644
--- a/cryptodev.py
+++ b/cryptodev.py
@@ -62,10 +62,16 @@ class LUKSDevice:
return self.scheme

def setDevice(self, device):
+ if self._device == device:
+ return
+
self._device = device
if device is not None:
+ if device.startswith("/dev/"):
+ device = device[5:]
+
name = "%s-%s" % (self.scheme.lower(),
- os.path.basename(device))
+ device.replace("/", "-"))
self.setName(name)

def getDevice(self, encrypted=0):
@@ -78,6 +84,9 @@ class LUKSDevice:

def setName(self, name, lock=False):
"""Set the name of the mapped device, eg: 'dmcrypt-sda3'"""
+ if self.name == name:
+ return
+
if self.name and not self.getStatus():
raise RuntimeError, "Cannot rename an active mapping."

--
1.5.4.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 07:58 AM.

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