From 67ff409410ef11b0023dab32f48bfaea8eb395bc Mon Sep 17 00:00:00 2001 From: fling Date: Thu, 28 Oct 2010 13:56:07 +0800 Subject: [PATCH] modified: ri_data.py modified: ri_oper.py fix extended partition doesn't exit MountPoint and MakeRaid spare is optional --- interface/ri_data.py | 2 +- interface/ri_oper.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/interface/ri_data.py b/interface/ri_data.py index aa96438..884f7ac 100644 --- a/interface/ri_data.py +++ b/interface/ri_data.py @@ -346,7 +346,7 @@ class MountPoint: # add raid device in dev_in_raid dev_in_raid = Raid.dev_in_raid() - for dev in set(Partition.dict.keys()).difference(set(dev_in_raid)): + for dev in set([ k for k in Partition.dict.keys() if not re.search('extended',Partition.dict[k].type)]).difference(set(dev_in_raid)): if MountPoint.dict.has_key(dev): continue MountPoint(dev, fs=Partition.dict[dev].filesystem) diff --git a/interface/ri_oper.py b/interface/ri_oper.py index 12b49b0..c6f8666 100644 --- a/interface/ri_oper.py +++ b/interface/ri_oper.py @@ -126,9 +126,10 @@ class MakeRaid(Operation): n = 0 for instance in ri_data.Raid.dict.values(): if instance.from_os == 'no': - args += '-n /dev/%s -l %s -s %s -a %s\n' %(instance.device, instance.level, \ - ','.join([ '/dev/%s' %sp for sp in instance.spare_components]), \ - ','.join([ '/dev/%s' %ac for ac in instance.active_components])) + args += '-n /dev/%s -l %s -a %s' %(instance.device, instance.level,','.join([ '/dev/%s' %ac for ac in instance.active_components])) + if instance.spare_components : + args += ' -s %s' % ','.join([ '/dev/%s' %sp for sp in instance.spare_components]) + args +='\n' n += 1 self.steps += n return args