コード例 #1
0
    def save(self):
        Device.save(self)
        conf = ConfDevice(self.DeviceId)
        conf["TYPE"] = "Ethernet"
        if not self.Alias:
            conf["NETTYPE"] = "lcs"
            ports = ""
            hardwarelist = getHardwareList()
            for hw in hardwarelist:
                if hw.Name == self.Device:
                    if hw.MacAddress:
                        conf["MACADDR"] = hw.MacAddress
                    else:
                        del conf["MACADDR"]

                    if (hw.Card.IoPort and hw.Card.IoPort1
                            and hw.Card.IoPort2):
                        ports = "%s,%s,%s" % (hw.Card.IoPort, hw.Card.IoPort1,
                                              hw.Card.IoPort2)
                    break
            if ports:
                conf["SUBCHANNELS"] = ports
            if hw.Card.Options:
                conf["OPTIONS"] = hw.Card.Options
            else:
                if conf.has_key("OPTIONS"):
                    del conf["OPTIONS"]

        conf.write()
コード例 #2
0
 def save(self):
     super(DevWireless, self).save()
     conf = ConfDevice(self.DeviceId)
     conf.fsf()
     self.Wireless.save(conf, self.DeviceId)
     conf.write()
     del conf
コード例 #3
0
 def save(self):
     super(DevModem, self).save()
     conf = ConfDevice(self.DeviceId)
     self.Dialup.save(conf, self.DeviceId, self.oldname)
     conf.write()