X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=modprobe.py;h=b56f5d5d984598958869c674d8b461615604050b;hb=433060307ffbaefe96d816c780908c05bce89355;hp=638ebfa388ae6e2654b2876b95961bc6dd1809d9;hpb=bd8f483c4f4bc66f57ef201fc14510aacfde247c;p=pyplnet.git diff --git a/modprobe.py b/modprobe.py index 638ebfa..b56f5d5 100644 --- a/modprobe.py +++ b/modprobe.py @@ -7,11 +7,11 @@ import os import tempfile -class Modprobe(): +class Modprobe: def __init__(self,filename="/etc/modprobe.conf"): self.conffile = {} self.origconffile = {} - for keyword in ("alias","options","install","remove","blacklist","MODULES"): + for keyword in ("alias","options","install","remove","blacklist","MODULES","#"): self.conffile[keyword]={} self.filename = filename @@ -24,7 +24,7 @@ class Modprobe(): table = self.conffile.get(command,None) if table == None: - print "WARNING: command %s not recognize. Ignoring!" % command + print "WARNING: command %s not recognized. Ignoring!" % command continue if command == "alias": @@ -99,6 +99,7 @@ class Modprobe(): os.chmod(filename,0644) return True else: + os.unlink(tmpnam) return False def probe(self,name):