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

feat(byobu/locale): install necessary packages when absent in images and cloud-config user-data wants to setup #5799

Merged

Conversation

blackboxsw
Copy link
Collaborator

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)

* feat(locale): support locales install on minimal images when cfg requests-


*  feat(byobu): support byobu install on minimal images when cfg requests

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

CLOUD_INIT_KEEP_INSTANCE=1 CLOUD_INIT_OS_IMAGE=noble CLOUD_INIT_CLOUD_INIT_SOURCE=IN_PLACE CLOUD_INIT_OS_IMAGE_TYPE=minimal tox -e integration-tests -- --last-failed tests/integration_tests/modules/test_combined.py::TestCombined::test_byobu tests/integration_tests/modules/test_combined.py::TestCombined::test_configured_locale

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

blackboxsw added a commit to blackboxsw/cloud-init that referenced this pull request Oct 8, 2024
@blackboxsw blackboxsw force-pushed the SC-1750-lxd-minimal-integration-testing branch from 1728520 to 2376872 Compare October 8, 2024 18:09
@blackboxsw blackboxsw changed the title feat(byobu/locahttps://github.com/blackboxswle) minimal feat(byobu/locale): install necessary packages when absent in images and cloud-config user-data wants to setup Oct 8, 2024
Copy link
Member

@TheRealFalcon TheRealFalcon left a 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!

@@ -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):
Copy link
Member

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

Copy link
Collaborator Author

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.

blackboxsw added a commit to blackboxsw/cloud-init that referenced this pull request Oct 8, 2024
@blackboxsw blackboxsw force-pushed the SC-1750-lxd-minimal-integration-testing branch from 2376872 to 84623e6 Compare October 8, 2024 20:14
Copy link
Member

@TheRealFalcon TheRealFalcon left a 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.

@blackboxsw blackboxsw force-pushed the SC-1750-lxd-minimal-integration-testing branch from 84623e6 to fd16cfb Compare October 8, 2024 20:25
Copy link
Member

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

LGTM!

@blackboxsw blackboxsw merged commit dba2dd3 into canonical:main Oct 9, 2024
21 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