Exemple #1
0
 def model(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id, "device/model"),
         "unkown").strip()
Exemple #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))
Exemple #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))
Exemple #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)
Exemple #5
0
 def slaves(self):
     path = os.path.join(SYSFS_NET_DEV, self.name, "bonding/slaves")
     return read_file_entry(path).split()
Exemple #6
0
 def group_name_list(self):
     return read_file_entry(BONDING_MASTERS, "").split()
Exemple #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))
Exemple #8
0
 def state(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id,
                      "device/state"), "running").strip()
Exemple #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
Exemple #10
0
 def model(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id,
                      "device/model"), "unkown").strip()
Exemple #11
0
 def rev(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id,
                      "device/rev"), "1.0").strip()
Exemple #12
0
 def slaves(self):
     path = os.path.join(SYSFS_NET_DEV, self.name, "bonding/slaves")
     return read_file_entry(path).split()
Exemple #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)
Exemple #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))
Exemple #15
0
 def rev(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id, "device/rev"),
         "1.0").strip()
Exemple #16
0
 def group_name_list(self):
     return read_file_entry(BONDING_MASTERS, "").split()
Exemple #17
0
 def state(self):
     return read_file_entry(
         os.path.join("/sys/class/scsi_device/", self.scsi_id, "device/state"),
         "running").strip()
Exemple #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