Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ctl: Don't call Fetch() if Poll() found no update
Calling Poll() causes a state change first to Polling, and then to one of the following: - Error - UpdateAvailable - Ready, which indicates that the poll was successful but no update is available. Previously, in that last case, `eos-updater-ctl update` would go ahead and try to call `Fetch()` anyway, leading to a scary Python backtrace: Traceback (most recent call last): File "/usr/bin/eos-updater-ctl", line 427, in <module> main() File "/usr/bin/eos-updater-ctl", line 423, in main sys.exit(args.function(**args_dict)) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/eos-updater-ctl", line 226, in command_update fetch_result = command_fetch(block=True, quiet=quiet, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/eos-updater-ctl", line 209, in command_fetch return command_dbus('fetch', block, quiet, parameters) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/eos-updater-ctl", line 177, in command_dbus proxy.call_sync(qualified_method_name, parameters, 0, -1, None) gi.repository.GLib.GError: g-io-error-quark: GDBus.Error:com.endlessm.Updater.Error.WrongState: Can't call Fetch() while in state Ready (36) Handle this case more gracefully by printing an explanatory message then exiting cleanly. https://phabricator.endlessm.com/T26906
- Loading branch information