Alert when a computer needs to be restarted

Bug #373259 reported by Free Ekanayaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Server
Fix Released
Medium
Jamu Kakar

Bug Description

An alert should be sent when a computer (or a group of computers)
needs to be restarted. The Computer.reboot_required field can be used
to check this condition.

 affects landscape

Revision history for this message
Jamu Kakar (jkakar) wrote :

The attached branch is based on account-get-computers linked in bug
#435013
.

Changed in landscape:
assignee: nobody → Jamu Kakar (jkakar)
importance: Undecided → Medium
milestone: none → 1.4.0
status: New → In Progress
tags: added: review
Revision history for this message
Jamu Kakar (jkakar) wrote :

We need to add a patch to add and enable the alert for all existing
accounts and computers, but that can be done in a subsequent branch.

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Nice and clean, +1!

[1]

+ """Alert activates when computers need to be rebooted."""

Maybe s/activates/activated/ ?

[2]

+ rule = self.account.create_rule(ComputerRebootAlert)

It looks like all tests eventually need this, what about moving it to self.setUp ? Or did you prefer not do it on purpose for better readability?

[3]

+ """
+ ComputerRebootAlert has a special email template displaying the list
+ of computers that require a reboot.
+ """

This test docstring is duplicated between test_email_notification and test_email_notification_with_many_computers.

Revision history for this message
Sidnei da Silva (sidnei) wrote :

Amazing! This looks like a really useful feature.

[1] Import order looks a bit odd here (I believe we always put functions last, at least I do. ;)

- ComputerOfflineAlert, check_offline_computers)
+ ComputerOfflineAlert, check_offline_computers, ComputerRebootAlert)

Other than that and Free's comments, nothing else to add. +1!

tags: removed: review
Revision history for this message
Jamu Kakar (jkakar) wrote :

Free:

[1]

The docstring is correct as it is.

[2]

I didn't think about it explicitly, but yeah, I think it's nice to
have it near the test logic instead of in setUp.

[3]

Fixed.

Sidnei:

[1]

Fixed.

I've linked another branch to bug #438456 that adds a patch to add
the new rule to all accounts and enable it for all computers. I'll
land this branch when that one is ready to land.

Revision history for this message
Jamu Kakar (jkakar) wrote :

Merged to landscape/trunk r1382 [r=free,sidnei].

Changed in landscape:
status: In Progress → Fix Committed
Jamu Kakar (jkakar)
tags: added: needs-testing
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

verified in staging

tags: removed: needs-testing
Jamu Kakar (jkakar)
Changed in landscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.