Skip to content

archlinux: fix package upgrade command handling#768

Merged
mitechie merged 2 commits into
canonical:masterfrom
baodrate:master
Jan 12, 2021
Merged

archlinux: fix package upgrade command handling#768
mitechie merged 2 commits into
canonical:masterfrom
baodrate:master

Conversation

@baodrate
Copy link
Copy Markdown
Contributor

Proposed Commit Message

archlinux: fix package upgrade command handling

pacman uses `-u` instead of `upgrade` to trigger a system upgrade, fix
the command handling so this is properly accounted for. as is, the
resulting command attempts to install a (non-existent) `upgrade` package

Additional Context

Pretty straightforward. Arch's pacman uses -u instead of upgrade (see man 8 pacman). Without this change I get an error when package_upgrade: true:

Cloud-init v. 20.4 running 'single' at Tue, 12 Jan 2021 00:37:17 +0000. Up 3995.82 seconds.
:: Synchronizing package databases...
error: target not found: upgrade
 core is up to date
 extra is up to date
 community is up to date
2021-01-12 00:37:17,927 - util.py[WARNING]: Package upgrade failed
2021-01-12 00:37:17,928 - cc_package_update_upgrade_install.py[WARNING]: 1 failed with exceptions, re-raising the last one
2021-01-12 00:37:17,928 - util.py[WARNING]: Running module package-update-upgrade-install (<module 'cloudinit.config.cc_package_update_upgrade_install' from '/usr/lib/python3.9/site-packages/cloudinit/config/cc_package_update_upgrade_install.py'>) failed
2021-01-12 00:37:17,929 - main.py[WARNING]: Ran package-update-upgrade-install but it failed!

Test Steps

I think some tests for this would be good to avoid regressions but I'm pretty unfamiliar with cloud-init and moreso with the project's testing setup. Any help would be appreciated

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

baodrate and others added 2 commits January 11, 2021 18:44
pacman uses `-u` instead of `upgrade` to trigger a system upgrade, fix
the command handling so this is properly accounted for. as is, the
resulting command attempts to install a (non-existent) `upgrade` package
@mitechie mitechie merged commit 2b2c7f3 into canonical:master Jan 12, 2021
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