/[smeserver]/cdrom.image/sme9/updates/storage/__init__.py
ViewVC logotype

Diff of /cdrom.image/sme9/updates/storage/__init__.py

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.3 by wellsi, Wed Nov 6 02:06:23 2013 UTC Revision 1.4 by wellsi, Tue Dec 3 04:09:59 2013 UTC
# Line 918  class Storage(object): Line 918  class Storage(object):
918          vgnames = [vg.name for vg in self.vgs]          vgnames = [vg.name for vg in self.vgs]
919          if hn is not None and hn != '':          if hn is not None and hn != '':
920              if hn == 'localhost' or hn == 'localhost.localdomain':              if hn == 'localhost' or hn == 'localhost.localdomain':
921                  vgtemplate = "VolGroup"                  vgtemplate = "main"
922              elif hn.find('.') != -1:              elif hn.find('.') != -1:
923                  template = "vg_%s" % (hn.split('.')[0].lower(),)                  template = "vg_%s" % (hn.split('.')[0].lower(),)
924                  vgtemplate = safeLvmName(template)                  vgtemplate = safeLvmName(template)
# Line 926  class Storage(object): Line 926  class Storage(object):
926                  template = "vg_%s" % (hn.lower(),)                  template = "vg_%s" % (hn.lower(),)
927                  vgtemplate = safeLvmName(template)                  vgtemplate = safeLvmName(template)
928          else:          else:
929              vgtemplate = "VolGroup"              vgtemplate = "main"
930    
931          if vgtemplate not in vgnames and \          if vgtemplate not in vgnames and \
932                  vgtemplate not in lvm.lvm_vg_blacklist:                  vgtemplate not in lvm.lvm_vg_blacklist:
# Line 951  class Storage(object): Line 951  class Storage(object):
951          if mountpoint:          if mountpoint:
952              # try to incorporate the mountpoint into the name              # try to incorporate the mountpoint into the name
953              if mountpoint == '/':              if mountpoint == '/':
954                  lvtemplate = 'lv_root'                  lvtemplate = 'root'
955              else:              else:
956                  if mountpoint.startswith("/"):                  if mountpoint.startswith("/"):
957                      template = "lv_%s" % mountpoint[1:]                      template = "%s" % mountpoint[1:]
958                  else:                  else:
959                      template = "lv_%s" % (mountpoint,)                      template = "%s" % (mountpoint,)
960    
961                  lvtemplate = safeLvmName(template)                  lvtemplate = safeLvmName(template)
962          else:          else:
# Line 964  class Storage(object): Line 964  class Storage(object):
964                  if len([s for s in self.swaps if s in vg.lvs]):                  if len([s for s in self.swaps if s in vg.lvs]):
965                      idx = len([s for s in self.swaps if s in vg.lvs])                      idx = len([s for s in self.swaps if s in vg.lvs])
966                      while True:                      while True:
967                          lvtemplate = "lv_swap%02d" % idx                          lvtemplate = "swap%02d" % idx
968                          if lvtemplate in [lv.lvname for lv in vg.lvs]:                          if lvtemplate in [lv.lvname for lv in vg.lvs]:
969                              idx += 1                              idx += 1
970                          else:                          else:
971                              break                              break
972                  else:                  else:
973                      lvtemplate = "lv_swap"                      lvtemplate = "swap"
974              else:              else:
975                  idx = len(vg.lvs)                  idx = len(vg.lvs)
976                  while True:                  while True:


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed