Comment 11 for bug 1926819

Revision history for this message
Lucas Albuquerque Medeiros de Moura (lamoura) wrote :

SRU template verification

[Impact]
On a system without updates to be installed, not showing any message in motd feels that something went wrong in the backend. Also, currently we are printing unwanted white spaces in that scenario, which is not a good user experience here.

[Test case]

To reproduce the issue, you can:

1. Launch a xenial container
2. Remove ubuntu-advantage-tools from the system
   This package will make update-notifier show more messages which are not needed in that test
3. Run an apt update
4. Install update-notifier
5. Run apt upgrade
6. Run /usr/lib/update-notifier/apt_check.py --human-readable
7. Verify we deliver an empty message

To verify that the error is fixed:

1. Run the past scenario until step 4
2. Install the new update-notifier from this ppa:
https://launchpad.net/~lamoura/+archive/ubuntu/update-notifier-test-ppa/
3. Run `/usr/lib/update-notifier/apt-check --human-readable`
4. Verify that the command print the following message:

   0 updates can be applied immediately.

[Where problems could occur]

We are bringing back a behavior that was already present in the package, but removed in the last version of it. We will now be impacting users that may not be relying in that message anymore. But we believe this should not be a huge issue if that happens, since users were already relying on the old behavior.

[Discussion]
Currently, motd will not output a message if the system does not have any updates to apply. However, this is not ideal since this may cause the impression that there is something wrong with motd or the system. Also, the empty message we produce in that scenario is not completely empty, it does contain some white spaces on it, which is completely unnecessary.

Because of that, we are bringing back the behavior of printing the message:

0 updates can be applied immediately.

If no updates need to be applied in the system.