Make colouring of keepalive printouts nicer

This commit is contained in:
Joshua Boniface 2018-06-07 00:39:09 -04:00
parent 1ee8fb99dc
commit d67ef9c9de
1 changed files with 7 additions and 7 deletions

View File

@ -194,9 +194,9 @@ class NodeInstance():
conn.close()
# Display node information to the terminal
ansiiprint.echo('{} keepalive'.format(self.name), '', 't')
ansiiprint.echo('CPUs: {} | Free memory: {} | Load: {}'.format(self.cpucount, self.memfree, self.cpuload), '', 'c')
ansiiprint.echo('Active domains: {}'.format(' '.join(self.domain_list)), '', 'c')
ansiiprint.echo('{}{} keepalive{}'.format(ansiiprint.purple(), self.name, ansiiprint.end()), '', 't')
ansiiprint.echo('{0}CPUs:{1} {2} {0}Free memory:{1} {3} {0}Load:{1} {4}'.format(ansiiprint.bold(), ansiiprint.end(), self.cpucount, self.memfree, self.cpuload), '', 'c')
ansiiprint.echo('{}Active domains:{} {}'.format(ansiiprint.bold(), ansiiprint.end(), ' '.join(self.domain_list)), '', 'c')
# Update our local node lists
for node_name in self.t_node:
@ -249,7 +249,7 @@ class NodeInstance():
pass
# Display cluster information to the terminal
ansiiprint.echo('Cluster status', '', 't')
ansiiprint.echo('{}Active{} nodes: {}'.format(ansiiprint.green(), ansiiprint.end(), ' '.join(self.active_node_list)), '', 'c')
ansiiprint.echo('{}Flushed{} nodes: {}'.format(ansiiprint.yellow(), ansiiprint.end(), ' '.join(self.flushed_node_list)), '', 'c')
ansiiprint.echo('{}Inactive{} nodes: {}'.format(ansiiprint.red(), ansiiprint.end(), ' '.join(self.inactive_node_list)), '', 'c')
ansiiprint.echo('{}Cluster status{}'.format(ansiiprint.purple(), ansiiprint.end()), '', 't')
ansiiprint.echo('{}Active nodes:{} {}'.format(ansiiprint.bold(), ansiiprint.end(), ' '.join(self.active_node_list)), '', 'c')
ansiiprint.echo('{}Flushed nodes:{} {}'.format(ansiiprint.bold(), ansiiprint.end(), ' '.join(self.flushed_node_list)), '', 'c')
ansiiprint.echo('{}Inactive nodes:{} {}'.format(ansiiprint.bold(), ansiiprint.end(), ' '.join(self.inactive_node_list)), '', 'c')