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

[OSMorphing] Add check for installed package #334

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

Cristi1324
Copy link
Contributor

This PR add check for installed package and checks that grubby is installed before trying to install it.

try:
self._exec_cmd_chroot(cmd)
return True
except Exception:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exception is too broad. Normally, we'd only like to catch whether a command fails, this catches any error. Please replace this with CoriolisException (this is what is raised if a command fails). Also, please add a log message:

LOG.warning(f"Package ${package_name} is not installed")
LOG.trace(utils.get_exception_details())

@Cristi1324 Cristi1324 force-pushed the check_grubby_installed branch from 0b1b9e2 to d8abfcb Compare August 22, 2024 11:38
@Dany9966 Dany9966 merged commit 24c52ea into cloudbase:master Aug 28, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants