Skip to content

Commit

Permalink
Make it possible to list all hosts of an aggregate
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt committed Nov 3, 2024
1 parent 8267c7d commit ffdd4e4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions osism/commands/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="?",
Expand All @@ -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:
Expand All @@ -133,6 +140,7 @@ def take_action(self, parsed_args):

else:
for service in conn.compute.services(**{"binary": "nova-compute"}):
print(service)
result.append(
[
service.id,
Expand Down

0 comments on commit ffdd4e4

Please sign in to comment.