Permalink
Browse files

added sanity checking for raid levels

  • Loading branch information...
1 parent 976a616 commit dde3ea5e4c3f97e0963d07079376b74ba0ae5601 @benneic committed May 24, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 raidformer.py
View
@@ -123,6 +123,11 @@ def initialize_filesystem(cmds, wipe, md_device, volgroup, logvol, format_cmds,
print "Cowardly will not wipe volumes created from snapshots. Loose the --wipe option if you want to restore from snapshots."
sys.exit(1)
+even_number_raidlevels = [10]
+
+if options.raidlevel in even_number_raidlevels and options.count % 2 != 0:
+ print "Number of volumes to be created in not compatible with raid level %s" % options.raidlevel
+ sys.exit(1)
my_devices = []

0 comments on commit dde3ea5

Please sign in to comment.