Skip to content

Commit

Permalink
Fix an error with date and cloudonly
Browse files Browse the repository at this point in the history
When calling cli with both --cloud-only and --date, if there
are no matching schedules, the current set of hosts is incorrectly
returned.

Fixes: #466
Change-Id: Ifb7f9da1e899c03829b6e38e1a712b1293898db2
  • Loading branch information
kambiz-aghaiepour committed Jan 31, 2024
1 parent 513557f commit a096620
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions quads/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1770,13 +1770,14 @@ def action_cloudonly(self):
if host in _hosts:
self.logger.info(host)
else:
_kwargs = {"cloud": _cloud}
if self.cli_args["filter"]:
filter_args = self._filter_kwargs(self.cli_args["filter"])
_kwargs.update(filter_args)
_hosts = Host.objects(**_kwargs).all()
for host in sorted(_hosts, key=lambda k: k["name"]):
self.logger.info(host.name)
if not _kwargs.get("date"):
_kwargs = {"cloud": _cloud}
if self.cli_args["filter"]:
filter_args = self._filter_kwargs(self.cli_args["filter"])
_kwargs.update(filter_args)
_hosts = Host.objects(**_kwargs).all()
for host in sorted(_hosts, key=lambda k: k["name"]):
self.logger.info(host.name)

def action_summary(self):
_kwargs = {}
Expand Down

0 comments on commit a096620

Please sign in to comment.