Skip to content

Instantly share code, notes, and snippets.

@spellancer
Last active December 26, 2015 03:29
Show Gist options
  • Save spellancer/7086775 to your computer and use it in GitHub Desktop.
Save spellancer/7086775 to your computer and use it in GitHub Desktop.
fin = open("input.xml", "r")
fout = open("output.xml","w")
a = fin.readlines()
for i in a:
if i.find("<type")!=-1 and i.find("<boot")==-1:
fout.write(i)
fout.write("<boot dev='hd'/>\n")
elif i.find("<kernel>")==-1 and i.find("<initrd>")==-1 and i.find("<cmdline>")==-1:
fout.write(i)
fin.close()
fout.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment