-
Notifications
You must be signed in to change notification settings - Fork 871
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
feat(byobu/locale): install necessary packages when absent in images and cloud-config user-data wants to setup #5799
feat(byobu/locale): install necessary packages when absent in images and cloud-config user-data wants to setup #5799
Conversation
1728520
to
2376872
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question inline but otherwise looks good. Thanks for the additional test coverage!
cloudinit/distros/debian.py
Outdated
@@ -282,7 +296,7 @@ def update_locale_conf(locale, sys_path, keyname="LANG"): | |||
) | |||
|
|||
|
|||
def regenerate_locale(locale, sys_path, keyname="LANG"): | |||
def regenerate_locale(locale, sys_path, keyname="LANG", install_callback=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we passing an install function here rather than calling self.install_packages
in the body?
Nit: I also wouldn't call this a callback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheRealFalcon do you mean do the subp.which call and install_packages up in Distro.apply_locale
?The regenerate_locale and update_locale_conf are functions which aren't defined on the class. Rather than pulling that function up into the class as a method, I chose to pass the Distro.install_packages function into those helpers. If you think it makes more sense (because we are using self.install_packages) to pull regenerate_locale and update_locale_conf up into the debian.Distro class I can do that instead.
2376872
to
84623e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The regenerate_locale and update_locale_conf are functions which aren't defined on the class.
Oooh, sorry, I missed that. It all makes sense now, thanks!
Still a nit about the name callback (install_function
or something might be better), but not blocking.
84623e6
to
fd16cfb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
rebase as separate commits
Install the necessary package dependencies (byobu or locales) when cloud-config directives provide configuration requesting setup and config of byobu or locales.
Addresses issues with minimal images not containing byobu or locales packages, yet user-data requests that specific setup and configuration.
Proposed Commit Message(s)
Additional Context
Failed jenkins job on ubuntu minimal
https://jenkins.canonical.com/server-team/view/cloud-init/job/cloud-init-integration-noble-lxd_container-minimal/lastSuccessfulBuild/
Test Steps
Merge type