Skip to content

Commit

Permalink
Some first ideas for implementing the task status checks
Browse files Browse the repository at this point in the history
  • Loading branch information
okin committed Oct 15, 2021
1 parent 36930da commit f7bc182
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
12 changes: 9 additions & 3 deletions katprep/cli/maintenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,14 @@ def status(options, args):
:param args: argparse options dictionary containing parameters
:type args: argparse options dict
"""
# I'M A PIECE OF SHIT AND NEED TO BE REPLACED
""" tasks = {
raise NotImplementedError("This functions needs a generic implementation")
# TODO: we have to find a way to handle this
# TODO: how to handle the call to the SAT_CLIENT?
# TODO: what it be good if SAT_CLIENT was a dict like for monitoring and virt?
# TODO: make the results generic

#verify snapshot/downtime per host
tasks = {
"Erratum": "Actions::Katello::Host::Erratum::Install",
"Package": "Actions::Katello::Host::Update"
}
Expand Down Expand Up @@ -438,7 +444,7 @@ def status(options, args):
task, host, result["result"]
)
except KeyError as kerr:
LOGGER.debug("Failed showing result: %r", kerr) """
LOGGER.debug("Failed showing result: %r", kerr)


def cleanup(options, args):
Expand Down
11 changes: 11 additions & 0 deletions katprep/management/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,14 @@ def is_reboot_required(self, host) -> bool:
Checks if the client requires a reboot.
"""

@abstractmethod
def get_errata_task_status(self, host):
"""
Get the status of errata installations for the given host.
"""

@abstractmethod
def get_upgrade_task_status(self, host):
"""
Get the status of package upgrades for the given host.
"""

0 comments on commit f7bc182

Please sign in to comment.