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 User

LinkBack Thread Tools
Old 05-07-2012, 04:04 PM
David Lehman
Default Fix suggestDeviceName to correctly avoid in-use lv names. (#812528)

There are two things the method was doing wrong:
1. not avoiding the names of lvs in the dialog's temporary vg
2. not using the full device name when checking numbered lv names
(lv device names are of the form "%s-%s" % (vgname, lvname))

There is another change here as well: if no distinguishing info is
passed in (eg: mountpoint, swap), default to numbered names from
the start. For the first three lvs you create, instead of lv, lv00,
lv01 you'll get lv00, lv01, lv02. Consistency.
pyanaconda/storage/__init__.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 89dfc67..8f46af8 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -1109,10 +1109,16 @@ class Storage(object):
full += name
return full

- if full_name(name, parent) in names:
+ # also include names of any lvs in the parent for the case of the
+ # temporary vg in the lvm dialogs, which can contain lvs that are
+ # not yet in the devicetree and therefore not in self.names
+ if hasattr(parent, "lvs"):
+ names.extend([full_name(d.lvname, parent) for d in parent.lvs])
+ if full_name(name, parent) in names or not body:
for i in range(100):
name = "%s%02d" % (template, i)
- if name not in names:
+ if full_name(name, parent) not in names:
name = ""

Anaconda-devel-list mailing list

Thread Tools

All times are GMT. The time now is 09:46 AM.

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