Try to correct a bug on OpenVZ / See Issue #141

This commit is contained in:
Nicolas Hennion 2012-12-20 18:02:58 +01:00
parent 9bc8746468
commit 10156275eb

View File

@ -1819,9 +1819,12 @@ class glancesScreen:
elapsed_time = max(1, self.__refresh_time) elapsed_time = max(1, self.__refresh_time)
# network interface name # network interface name
self.term_window.addnstr( ifname = network[i]['interface_name'].encode('ascii', 'ignore').split(':')[0]
self.network_y + 1 + i, self.network_x, if (len(ifname) > 8):
network[i]['interface_name'].encode('ascii', 'ignore') + ':', 8) ifname = '_'+ifname[-8:]
self.term_window.addnstr(
self.network_y + 1 + i, self.network_x,
ifname, 8)
# Byte/s or bit/s # Byte/s or bit/s
if self.net_byteps_tag: if self.net_byteps_tag:
@ -1869,7 +1872,7 @@ class glancesScreen:
for i in range(0, sensors_num): for i in range(0, sensors_num):
self.term_window.addnstr( self.term_window.addnstr(
self.sensors_y + 1 + i, self.sensors_x, self.sensors_y + 1 + i, self.sensors_x,
sensors[i]['label'] + ':', 21) sensors[i]['label'], 21)
self.term_window.addnstr( self.term_window.addnstr(
self.sensors_y + 1 + i, self.sensors_x + 20, self.sensors_y + 1 + i, self.sensors_x + 20,
format(sensors[i]['value'], '>3'), 3) format(sensors[i]['value'], '>3'), 3)
@ -1909,7 +1912,7 @@ class glancesScreen:
# partition name # partition name
self.term_window.addnstr( self.term_window.addnstr(
self.diskio_y + 1 + disk, self.diskio_x, self.diskio_y + 1 + disk, self.diskio_x,
diskio[disk]['disk_name'] + ':', 8) diskio[disk]['disk_name'], 8)
# in/s # in/s
ins = diskio[disk]['write_bytes'] // elapsed_time ins = diskio[disk]['write_bytes'] // elapsed_time