Пример #1
0
 def model(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id, "device/model"),
         "unkown").strip()
Пример #2
0
 def _get_if_encap(self, name):
     type_path = os.path.join(SYSFS_NET_DEV, name, "type")
     return int(read_file_entry(type_path, 1))
Пример #3
0
 def _get_if_encap(self, name):
     type_path = os.path.join(SYSFS_NET_DEV, name, "type")
     return int(read_file_entry(type_path, 1))
Пример #4
0
 def mode(self):
     """return mode"""
     path = os.path.join(SYSFS_NET_DEV, self.name, "bonding/mode")
     mode = read_file_entry(path).split()[1]
     return int(mode)
Пример #5
0
 def slaves(self):
     path = os.path.join(SYSFS_NET_DEV, self.name, "bonding/slaves")
     return read_file_entry(path).split()
Пример #6
0
 def group_name_list(self):
     return read_file_entry(BONDING_MASTERS, "").split()
Пример #7
0
 def miimon(self):
     """return miimon in ms"""
     path = os.path.join(SYSFS_NET_DEV, self.name, "bonding/miimon")
     return int(read_file_entry(path))
Пример #8
0
 def state(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id,
                      "device/state"), "running").strip()
Пример #9
0
 def get_group_list(self):
     group_list = []
     name_list = read_file_entry(BONDING_MASTERS, "").split()
     for group_name in name_list:
         group_list.append(BondGroup(group_name))
     return group_list
Пример #10
0
 def model(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id,
                      "device/model"), "unkown").strip()
Пример #11
0
 def rev(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id,
                      "device/rev"), "1.0").strip()
Пример #12
0
 def slaves(self):
     path = os.path.join(SYSFS_NET_DEV, self.name, "bonding/slaves")
     return read_file_entry(path).split()
Пример #13
0
 def mode(self):
     """return mode"""
     path = os.path.join(SYSFS_NET_DEV, self.name, "bonding/mode")
     mode = read_file_entry(path).split()[1]
     return int(mode)
Пример #14
0
 def miimon(self):
     """return miimon in ms"""
     path = os.path.join(SYSFS_NET_DEV, self.name, "bonding/miimon")
     return int(read_file_entry(path))
Пример #15
0
 def rev(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id, "device/rev"),
         "1.0").strip()
Пример #16
0
 def group_name_list(self):
     return read_file_entry(BONDING_MASTERS, "").split()
Пример #17
0
 def state(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id, "device/state"),
         "running").strip()
Пример #18
0
 def get_group_list(self):
     group_list = []
     name_list = read_file_entry(BONDING_MASTERS, "").split()
     for group_name in name_list:
         group_list.append(BondGroup(group_name))
     return group_list