Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Generalize task status checks #161

Draft
wants to merge 1 commit into
base: 43-feat-uyuni_support
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
"""