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 > Ubuntu > Xubuntu Development

 
 
LinkBack Thread Tools
 
Old 05-07-2012, 04:24 PM
"Brian C. Lane"
 
Default Fix suggestDeviceName to correctly avoid in-use lv names. (#812528)

On Mon, May 07, 2012 at 11:04:31AM -0500, David Lehman wrote:
> 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:
> break
> else:
> name = ""
> --
> 1.7.6

Ack

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
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 10:37 PM.

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