diff -Nru ubuntu-advantage-tools-31.1~16.04/.github/workflows/ci-integration.yaml ubuntu-advantage-tools-31.2~16.04/.github/workflows/ci-integration.yaml --- ubuntu-advantage-tools-31.1~16.04/.github/workflows/ci-integration.yaml 2024-01-18 17:34:13.000000000 +0000 +++ ubuntu-advantage-tools-31.2~16.04/.github/workflows/ci-integration.yaml 2024-02-29 14:03:11.000000000 +0000 @@ -27,7 +27,7 @@ runs-on: ubuntu-22.04 strategy: matrix: - release: ['xenial', 'bionic', 'focal', 'jammy', 'mantic', 'noble'] + release: ['xenial', 'bionic', 'focal', 'jammy', 'mantic'] # , 'noble'] TODO flake8 is broken in noble as of Feb 21 2024. Add back once python3-flake8 >6 (currently in -proposed) gets into noble steps: - name: Prepare build tools env: diff -Nru ubuntu-advantage-tools-31.1~16.04/debian/changelog ubuntu-advantage-tools-31.2~16.04/debian/changelog --- ubuntu-advantage-tools-31.1~16.04/debian/changelog 2024-02-15 14:39:55.000000000 +0000 +++ ubuntu-advantage-tools-31.2~16.04/debian/changelog 2024-02-29 14:03:11.000000000 +0000 @@ -1,8 +1,19 @@ -ubuntu-advantage-tools (31.1~16.04) xenial; urgency=medium +ubuntu-advantage-tools (31.2~16.04) xenial; urgency=medium * Backport new upstream release (LP: #2048921) - -- Grant Orndorff Thu, 15 Feb 2024 09:39:55 -0500 + -- Grant Orndorff Thu, 29 Feb 2024 09:03:11 -0500 + +ubuntu-advantage-tools (31.2) noble; urgency=medium + + * properly rename logrotate conffile to avoid duplicate confiles, keep user changes + and avoid unnecessary prompts (LP: #2055046) + * use mv_conffile on all ubuntu-advantage-tools conffiles to avoid "obsolete" dpkg + conffile statuses + * fix regression in api u.pro.attach.auto.should_auto_attach.v1 so that it works with + the new package names + + -- Grant Orndorff Mon, 26 Feb 2024 11:47:55 -0500 ubuntu-advantage-tools (31.1) noble; urgency=medium diff -Nru ubuntu-advantage-tools-31.1~16.04/debian/ubuntu-advantage-tools.maintscript ubuntu-advantage-tools-31.2~16.04/debian/ubuntu-advantage-tools.maintscript --- ubuntu-advantage-tools-31.1~16.04/debian/ubuntu-advantage-tools.maintscript 2023-11-30 17:00:11.000000000 +0000 +++ ubuntu-advantage-tools-31.2~16.04/debian/ubuntu-advantage-tools.maintscript 2024-02-29 14:03:11.000000000 +0000 @@ -5,3 +5,10 @@ rm_conffile /etc/init/ua-auto-attach.conf 20.2~ ubuntu-advantage-tools rm_conffile /etc/update-motd.d/88-esm-announce 27.14~ ubuntu-advantage-tools rm_conffile /etc/ubuntu-advantage/help_data.yaml 30~ ubuntu-advantage-tools +mv_conffile /etc/logrotate.d/ubuntu-advantage-tools /etc/logrotate.d/ubuntu-pro-client 31.2~ ubuntu-advantage-tools +mv_conffile /etc/apt/apt.conf.d/20apt-esm-hook.conf /etc/apt/apt.conf.d/20apt-esm-hook.conf 31.2~ ubuntu-advantage-tools +mv_conffile /etc/apt/preferences.d/ubuntu-pro-esm-apps /etc/apt/preferences.d/ubuntu-pro-esm-apps 31.2~ ubuntu-advantage-tools +mv_conffile /etc/apt/preferences.d/ubuntu-pro-esm-infra /etc/apt/preferences.d/ubuntu-pro-esm-infra 31.2~ ubuntu-advantage-tools +mv_conffile /etc/ubuntu-advantage/uaclient.conf /etc/ubuntu-advantage/uaclient.conf 31.2~ ubuntu-advantage-tools +mv_conffile /etc/update-manager/release-upgrades.d/ubuntu-advantage-upgrades.cfg /etc/update-manager/release-upgrades.d/ubuntu-advantage-upgrades.cfg 31.2~ ubuntu-advantage-tools +mv_conffile /etc/update-motd.d/91-contract-ua-esm-status /etc/update-motd.d/91-contract-ua-esm-status 31.2~ ubuntu-advantage-tools diff -Nru ubuntu-advantage-tools-31.1~16.04/features/attached_commands.feature ubuntu-advantage-tools-31.2~16.04/features/attached_commands.feature --- ubuntu-advantage-tools-31.1~16.04/features/attached_commands.feature 2024-02-14 15:37:46.000000000 +0000 +++ ubuntu-advantage-tools-31.2~16.04/features/attached_commands.feature 2024-02-29 14:03:11.000000000 +0000 @@ -34,19 +34,6 @@ """ Successfully updated Ubuntu Pro related APT and MOTD messages. """ - When I run `python3 /usr/lib/ubuntu-advantage/timer.py` with sudo - And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root - Then stdout matches regexp: - """ - /var/log/ubuntu-advantage.log - """ - When I run `logrotate --force /etc/logrotate.d/ubuntu-pro-client` with sudo - And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root - Then stdout matches regexp: - """ - /var/log/ubuntu-advantage.log - /var/log/ubuntu-advantage.log.1 - """ Examples: ubuntu release | release | machine_type | diff -Nru ubuntu-advantage-tools-31.1~16.04/features/logs.feature ubuntu-advantage-tools-31.2~16.04/features/logs.feature --- ubuntu-advantage-tools-31.1~16.04/features/logs.feature 2024-01-18 17:34:13.000000000 +0000 +++ ubuntu-advantage-tools-31.2~16.04/features/logs.feature 2024-02-29 14:03:11.000000000 +0000 @@ -80,3 +80,51 @@ | focal | lxd-container | | jammy | lxd-container | | mantic | lxd-container | + + Scenario Outline: logrotate configuration works + Given a `` `` machine with ubuntu-advantage-tools installed + When I run `pro status` with sudo + And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root + Then stdout contains substring: + """ + /var/log/ubuntu-advantage.log + """ + Then stdout does not contain substring: + """ + /var/log/ubuntu-advantage.log.1 + """ + When I run `logrotate --force /etc/logrotate.d/ubuntu-pro-client` with sudo + And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root + Then stdout contains substring: + """ + /var/log/ubuntu-advantage.log + /var/log/ubuntu-advantage.log.1 + """ + # reset and run logrotate with full config + When I run `rm /var/log/ubuntu-advantage.log.1` with sudo + When I run `pro status` with sudo + And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root + Then stdout contains substring: + """ + /var/log/ubuntu-advantage.log + """ + Then stdout does not contain substring: + """ + /var/log/ubuntu-advantage.log.1 + """ + # This uses all logrotate config files on the system + When I run `logrotate --force /etc/logrotate.conf` with sudo + And I run `sh -c "ls /var/log/ubuntu-advantage* | sort -d"` as non-root + Then stdout contains substring: + """ + /var/log/ubuntu-advantage.log + /var/log/ubuntu-advantage.log.1 + """ + + Examples: ubuntu release + | release | machine_type | + | xenial | lxd-container | + | bionic | lxd-container | + | focal | lxd-container | + | jammy | lxd-container | + | mantic | lxd-container | diff -Nru ubuntu-advantage-tools-31.1~16.04/test-requirements.txt ubuntu-advantage-tools-31.2~16.04/test-requirements.txt --- ubuntu-advantage-tools-31.1~16.04/test-requirements.txt 2023-11-30 17:00:11.000000000 +0000 +++ ubuntu-advantage-tools-31.2~16.04/test-requirements.txt 2024-02-29 14:03:11.000000000 +0000 @@ -10,4 +10,12 @@ # python3-apt # We know it is in the distro, but for testing in venvs we need to install it # And well, there is no pypi package -git+https://salsa.debian.org/apt-team/python-apt@main +# We are using git-ubuntu to get the proper version by python version. +# We try to support the latest LTS, the latest released version, +# and the devel version. +# fixme: This may cause weird behavior in the future, or even break, if +# two releases have the same python_version. +git+https://git.launchpad.net/ubuntu/+source/python-apt@ubuntu/jammy-updates ; python_version == '3.10' +git+https://git.launchpad.net/ubuntu/+source/python-apt@ubuntu/mantic ; python_version == '3.11' +# need to keep an aye to bump this when python-apt is in noble-updates +git+https://git.launchpad.net/ubuntu/+source/python-apt@ubuntu/noble ; python_version == '3.12' diff -Nru ubuntu-advantage-tools-31.1~16.04/uaclient/api/u/pro/attach/auto/should_auto_attach/v1.py ubuntu-advantage-tools-31.2~16.04/uaclient/api/u/pro/attach/auto/should_auto_attach/v1.py --- ubuntu-advantage-tools-31.1~16.04/uaclient/api/u/pro/attach/auto/should_auto_attach/v1.py 2023-11-30 17:00:11.000000000 +0000 +++ ubuntu-advantage-tools-31.2~16.04/uaclient/api/u/pro/attach/auto/should_auto_attach/v1.py 2024-02-29 14:03:11.000000000 +0000 @@ -29,7 +29,8 @@ ) return ShouldAutoAttachResult( - should_auto_attach=is_installed("ubuntu-advantage-pro"), + should_auto_attach=is_installed("ubuntu-advantage-pro") + or is_installed("ubuntu-pro-auto-attach"), ) diff -Nru ubuntu-advantage-tools-31.1~16.04/uaclient/tests/test_version.py ubuntu-advantage-tools-31.2~16.04/uaclient/tests/test_version.py --- ubuntu-advantage-tools-31.1~16.04/uaclient/tests/test_version.py 2023-11-30 17:00:11.000000000 +0000 +++ ubuntu-advantage-tools-31.2~16.04/uaclient/tests/test_version.py 2024-02-29 14:03:11.000000000 +0000 @@ -86,7 +86,7 @@ class TestCheckForNewVersion: @pytest.mark.parametrize("compare_return", (-1, 0, 1)) @mock.patch("uaclient.version.version_compare") - @mock.patch("uaclient.version.get_pkg_candidate_version") + @mock.patch("uaclient.version.get_last_known_candidate") def test_check_for_new_version( self, m_candidate, m_compare, compare_return ): diff -Nru ubuntu-advantage-tools-31.1~16.04/uaclient/version.py ubuntu-advantage-tools-31.2~16.04/uaclient/version.py --- ubuntu-advantage-tools-31.1~16.04/uaclient/version.py 2024-02-14 19:39:47.000000000 +0000 +++ ubuntu-advantage-tools-31.2~16.04/uaclient/version.py 2024-02-29 14:03:11.000000000 +0000 @@ -14,7 +14,7 @@ from uaclient.exceptions import ProcessExecutionError from uaclient.system import subp -__VERSION__ = "31.1" +__VERSION__ = "31.2" PACKAGED_VERSION = "@@PACKAGED_VERSION@@"