+def modify_grub_config(filename):
+ if options.removeoption:
+ regexe = []
+ for regex in options.removeoption:
+ regexe.append(re.compile(r'%s' % regex))
+
+ option_re = re.compile(r'(.*/boot/release/.*linux26.*)')
+
+ for line in fileinput.input(filename, inplace=1):
+ if regexe and option_re.search(line):
+ for regex in regexe:
+ line = regex.sub(' ', line)
+
+ sys.stdout.write(line)
+
+ fileinput.close()
+