2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 01:22:00 +00:00

Fix gathered output with non-rectangular geometry

If we don't have a nice rectangular count of systems,
the last row must tolerate index error in column.
This commit is contained in:
Jarrod Johnson 2021-11-16 06:37:59 -05:00
parent 8ee3630aa1
commit 2ef2e4d039

View File

@ -69,8 +69,11 @@ class ScreenPrinter(object):
columns = [self.nodelist[x:x+currheight] for x in range(0, len(self.nodelist), currheight)]
for currow in range(0, len(columns[0])):
for col in columns:
node = col[currow]
sys.stdout.write(fieldformat.format(node, self.nodeoutput[node]))
try:
node = col[currow]
sys.stdout.write(fieldformat.format(node, self.nodeoutput[node]))
except IndexError:
break
sys.stdout.write('\n')
else:
for node in self.nodelist: