Example #1
0
 def __init__(self, dir, iface):
     IfcfgFile.__init__(self, dir, iface)
     self.description = ""
     if iface.startswith('ctc'):
         self.info["TYPE"] = "CTC"
     self.wepkey = ""
     self._dirty = False
Example #2
0
 def __init__(self, dir, iface):
     IfcfgFile.__init__(self, dir, iface)
     self.description = ""
     if iface.startswith('ctc'):
         self.info["TYPE"] = "CTC"
     self.wepkey = ""
     self._dirty = False
Example #3
0
 def writeIfcfgFile(self):
     # Write out the file only if there is a key whose
     # value has been changed since last load of ifcfg file.
     if self._dirty:
         IfcfgFile.write(self)
         self.log("NetworkDevice written to %s\n" % self.path)
         self._dirty = False
Example #4
0
    def loadIfcfgFile(self):
        ifcfglog.debug("%s:\n%s" % (self.path, self.fileContent()))
        ifcfglog.debug("NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
        ifcfglog.debug("loadIfcfgFile %s from %s" % (self.iface, self.path))
        self.clear()
        IfcfgFile.read(self)
        self._dirty = False

        ifcfglog.debug("NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
Example #5
0
    def loadIfcfgFile(self):
        ifcfglog.debug("%s:\n%s" % (self.path, self.fileContent()))
        ifcfglog.debug("NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
        ifcfglog.debug("loadIfcfgFile %s from %s" % (self.iface, self.path))
        self.clear()
        IfcfgFile.read(self)
        self._dirty = False

        ifcfglog.debug("NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
Example #6
0
 def writeIfcfgFile(self):
     # Write out the file only if there is a key whose
     # value has been changed since last load of ifcfg file.
     ifcfglog.debug("%s:\n%s" % (self.path, self.fileContent()))
     ifcfglog.debug("NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
     ifcfglog.debug("writeIfcfgFile %s to %s%s" % (self.iface, self.path,
                                                   ("" if self._dirty else " not needed")))
     if self._dirty:
         IfcfgFile.write(self)
         self._dirty = False
Example #7
0
 def writeIfcfgFile(self):
     # Write out the file only if there is a key whose
     # value has been changed since last load of ifcfg file.
     ifcfglog.debug("%s:\n%s" % (self.path, self.fileContent()))
     ifcfglog.debug("NetworkDevice %s:\n%s" % (self.iface, self.__str__()))
     ifcfglog.debug("writeIfcfgFile %s to %s%s" % (self.iface, self.path,
                                                   ("" if self._dirty else " not needed")))
     if self._dirty:
         IfcfgFile.write(self)
         self._dirty = False
Example #8
0
 def set(self, *args):
     # If we are changing value of a key set _dirty flag
     # informing that ifcfg file needs to be synced.
     for (key, data) in args:
         if self.get(key) != data:
             break
     else:
         return
     IfcfgFile.set(self, *args)
     self._dirty = True
Example #9
0
 def set(self, *args):
     # If we are changing value of a key set _dirty flag
     # informing that ifcfg file needs to be synced.
     s = " ".join(["%s=%s" % key_val for key_val in args])
     ifcfglog.debug("NetworkDevice %s set: %s" % (self.iface, s))
     for (key, data) in args:
         if self.get(key) != data:
             break
     else:
         return
     IfcfgFile.set(self, *args)
     self._dirty = True
Example #10
0
 def set(self, *args):
     # If we are changing value of a key set _dirty flag
     # informing that ifcfg file needs to be synced.
     s = " ".join(["%s=%s" % key_val for key_val in args])
     ifcfglog.debug("NetworkDevice %s set: %s" %
                    (self.iface, s))
     for (key, data) in args:
         if self.get(key) != data:
             break
     else:
         return
     IfcfgFile.set(self, *args)
     self._dirty = True
Example #11
0
 def clear(self):
     IfcfgFile.clear(self)
     if self.iface.startswith('ctc'):
         self.info["TYPE"] = "CTC"
Example #12
0
 def clear(self):
     IfcfgFile.clear(self)
     if self.iface.startswith('ctc'):
         self.info["TYPE"] = "CTC"
Example #13
0
 def log_values(self, header="\n"):
     lf = open(self.logfile, 'a')
     lf.write(header)
     lf.write("== values for file %s\n" % self.path)
     lf.write(IfcfgFile.__str__(self))
     lf.close()
Example #14
0
 def loadIfcfgFile(self):
     self.clear()
     IfcfgFile.read(self)
     self.log("NetworkDevice read from %s\n" % self.path)
     self._dirty = False
    def loadIfcfgFile(self):
        ifcfglog.debug("loadIfcfFile %s" % self.path)

        self.clear()
        IfcfgFile.read(self)
        self._dirty = False