From 1af777ff402e25bfe70655fcb7f826f934870e46 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Sun, 3 Nov 2024 19:09:34 +0100 Subject: [PATCH] Make it possible to list all hosts of an aggregate Signed-off-by: Christian Berendt --- osism/commands/compute.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/osism/commands/compute.py b/osism/commands/compute.py index 35d7427c..29c1d0c1 100644 --- a/osism/commands/compute.py +++ b/osism/commands/compute.py @@ -96,6 +96,12 @@ def get_parser(self, prog_name): type=str, help="Filter by domain ID", ) + parser.add_argument( + "--aggregate", + default=None, + type=str, + help="Filter by aggregate", + ) parser.add_argument( "host", nargs="?", @@ -110,6 +116,7 @@ def take_action(self, parsed_args): conn = get_cloud_connection() domain = parsed_args.domain project = parsed_args.project + aggregate = parsed_args.aggregate result = [] if host: @@ -132,6 +139,10 @@ def take_action(self, parsed_args): ) else: + hypervisors = conn.compute.hypervisors() + for hypervisor in conn.compute.hypervisors(details=True): + print(hypervisor) + for service in conn.compute.services(**{"binary": "nova-compute"}): result.append( [