Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Laptop (http://www.linux-archive.org/debian-laptop/)
-   -   Clean up vg name generator and default to "vg_image" in image installs. (http://www.linux-archive.org/debian-laptop/490754-clean-up-vg-name-generator-default-vg_image-image-installs.html)

David Lehman 02-17-2011 05:22 PM

Clean up vg name generator and default to "vg_image" in image installs.
 
---
pyanaconda/storage/__init__.py | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 0309f28..ddac09c 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -936,19 +936,15 @@ class Storage(object):
def createSuggestedVGName(self, hostname=None):
""" Return a reasonable, unused VG name. """
# try to create a volume group name incorporating the hostname
- vgnames = [vg.name for vg in self.vgs]
- if hostname is not None and hostname != ':
- if hostname == 'localhost' or hostname == 'localhost.localdomain':
- vgtemplate = "VolGroup"
- elif hostname.find('.') != -1:
- template = "vg_%s" % (hostname.split('.')[0].lower(),)
- vgtemplate = safeLvmName(template)
- else:
- template = "vg_%s" % (hostname.lower(),)
- vgtemplate = safeLvmName(template)
+ if hostname not in (None, "", 'localhost', 'localhost.localdomain'):
+ template = "vg_%s" % (hostname.split('.')[0].lower(),)
+ vgtemplate = safeLvmName(template)
+ elif flags.imageInstall:
+ vgtemplate = "vg_image"
else:
vgtemplate = "VolGroup"

+ vgnames = [vg.name for vg in self.vgs]
if vgtemplate not in vgnames and
vgtemplate not in lvm.lvm_vg_blacklist:
return vgtemplate
--
1.7.3.4

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


All times are GMT. The time now is 03:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.