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
Autoremove reporting #11
Conversation
d2e534f
to
4073ccb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM.
|
||
self.store.set_hash_ids({HASH1: 1, HASH2: 2, HASH3: 3}) | ||
self.store.add_available([1, 2, 3]) | ||
self.store.add_autoremovable([1, 2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worth adding a note here pointing out that add_installed() is never called, which is why not-autoremovable is what it is.
FWIW, I also find this approach to exercising not-autoremovable to be a little odd. At what point would the store mark a package as auto-removable but not installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't confuse the client store state with the apt package status. Unless the apt package is marked auto and not depended upon, it would still be flagged as not-autoremovable. It's true that in practice the installed state will come with autoremovable state in the store, but I don't care about exercising that path in this test.
I'll add a comment. on the logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good
This changes adds client bits to report autoremovable packages back to landscape-server so it can act on them. lp:1208393
Testing:
sudo apt-get install sl && sudo apt-mark auto sl && apt-get autoremove --dry-run
sudo ./scripts/landscape-client -c root-client.conf
accept in landscape, wait forever for package data to sync or not (server doesn't know about that field)
/tmp/landscape-root/package-reporter.log should queue autoremovable once (those are diffs)
grep autoremovable /tmp/landscape-root/broker.log # shows package report being sent even if currently ignored by servers