mirror of
				https://github.com/xcat2/confluent.git
				synced 2025-10-26 08:55:31 +00:00 
			
		
		
		
	Improve collective show readability
This commit is contained in:
		| @@ -74,7 +74,21 @@ def show_collective(): | ||||
|     s = client.Command().connection | ||||
|     tlvdata.send(s, {'collective': {'operation': 'show'}}) | ||||
|     res = tlvdata.recv(s) | ||||
|     print(repr(res)) | ||||
|     if 'error' in res['collective']: | ||||
|         print(res['error']['collective']) | ||||
|         return | ||||
|     print('Leader: {0}'.format(res['collective']['leader'])) | ||||
|     if 'active' in res['collective']: | ||||
|         if res['collective']['active']: | ||||
|             print('Active collective members:') | ||||
|             for member in res['collective']['active']: | ||||
|                 print('    {0}'.format(member)) | ||||
|         if res['collective']['offline']: | ||||
|             print('Offline collective members:') | ||||
|             for member in res['collective']['offline']: | ||||
|                 print('    {0}'.format(member)) | ||||
|     else: | ||||
|         print('Run collective show on leader for more data') | ||||
|  | ||||
| def main(): | ||||
|     a = argparse.ArgumentParser(description='Confluent server utility') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user