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

pro: replace deprecated cloud-init key ubuntu_advantage #2069

Draft
wants to merge 1 commit into
base: main
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
2 changes: 1 addition & 1 deletion scripts/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ python3 scripts/check-yaml-fields.py "$tmpdir"/var/log/installer/curtin-install/
python3 scripts/check-yaml-fields.py <(python3 scripts/check-yaml-fields.py $tmpdir/etc/cloud/cloud.cfg.d/99-installer.cfg datasource.None.userdata_raw) \
locale='"en_GB.UTF-8"' \
timezone='"Pacific/Guam"' \
ubuntu_advantage.token='"C1NWcZTHLteJXGVMM6YhvHDpGrhyy7"' \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Encoding a token publicly in a repo gave me pause, but Just confirmed that this token is, in fact, invalid/not real and cannot be used to attach.

ubuntu_pro.token='"C1NWcZTHLteJXGVMM6YhvHDpGrhyy7"' \
'snap.commands=[snap install --channel=3.2/stable etcd]'
grep -q 'finish: subiquity/Install/install/postinstall/install_package1: SUCCESS: installing package1' \
$tmpdir/subiquity-server-debug.log
Expand Down
2 changes: 1 addition & 1 deletion subiquity/models/tests/test_ubuntu_pro.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_make_cloudconfig_(self):
# Test with a token
model.token = "0a1b2c3d4e5f6"
expected = {
"ubuntu_advantage": {
"ubuntu_pro": {
"token": "0a1b2c3d4e5f6",
}
}
Expand Down
5 changes: 1 addition & 4 deletions subiquity/models/ubuntu_pro.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,8 @@ def make_cloudconfig(self) -> dict:
"""
if not self.token:
return {}
# Both "ubuntu_advantage" and "ubuntu-advantage" keys are accepted, but
# "ubuntu-advantage" is deprecated despite not being mentioned in the
# documentation.
return {
"ubuntu_advantage": {
"ubuntu_pro": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ogayot looks good to me. Moving to ubuntu_pro is supported on 20.04 and later for cloud-init version 24.1 which published to the archive in June.

There are two uploads under review that will make this valid as well for 16.04 and 18.04 if that becomes something you need to support, but that hasn't landed yet.

"token": self.token,
},
}
Loading