From 5a5567954e51d44998c57f87f8ad77ef7bc24aeb Mon Sep 17 00:00:00 2001 From: Alexander Saprykin Date: Thu, 18 Feb 2016 12:51:41 +0200 Subject: [PATCH] Add node NUMA topology to "fuel2 node show" command Change-Id: I977852c50771259be1fa8688261a02b254d34acb Implements: blueprint support-numa-cpu-pinning --- fuelclient/commands/node.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fuelclient/commands/node.py b/fuelclient/commands/node.py index 6844455f..7f158577 100644 --- a/fuelclient/commands/node.py +++ b/fuelclient/commands/node.py @@ -65,6 +65,11 @@ class NodeList(NodeMixIn, base.BaseListCommand): class NodeShow(NodeMixIn, base.BaseShowCommand): """Show info about node with given id.""" + numa_fields = ( + 'numa_nodes', + 'supported_hugepages', + 'distances') + columns = ('id', 'name', 'status', @@ -87,6 +92,17 @@ class NodeShow(NodeMixIn, base.BaseShowCommand): # TODO(romcheg): network_data mostly never fits the screen # 'network_data', 'manufacturer') + columns += numa_fields + + def take_action(self, parsed_args): + data = self.client.get_by_id(parsed_args.id) + + numa_topology = data['meta'].get('numa_topology', {}) + for key in self.numa_fields: + data[key] = numa_topology.get(key) + + data = data_utils.get_display_data_single(self.columns, data) + return self.columns, data class NodeUpdate(NodeMixIn, base.BaseShowCommand):