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

Add optional version parameter to has_module() #192

Open
ekohl opened this issue Nov 5, 2021 · 0 comments
Open

Add optional version parameter to has_module() #192

ekohl opened this issue Nov 5, 2021 · 0 comments

Comments

@ekohl
Copy link
Member

ekohl commented Nov 5, 2021

Currently extlib::has_module($name) can be used to check if a module is present. It could benefit from an optional parameter to check for a specific version (range). This could allow easy soft dependency checks with version numbers:

if $git {
  unless extlib::has_module('theforeman-git', '>= 5.0.0 < 8.0.0') {
    fail('theforeman-git 5.x, 6.x or 7.x is needed for this functionality')
  }
}

If the parameter is not specified, it should use the current behavior. It would be equivalent to having a default value of >= 0.

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

No branches or pull requests

1 participant