diff mbox

[Branch,~linaro-validation/lava-scheduler/trunk] Rev 146: Add an admin action to put all passing boards into unknown health state, for use after a rollout.

Message ID 20120313010410.2843.6711.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson March 13, 2012, 1:04 a.m. UTC
Merge authors:
  Michael Hudson-Doyle (mwhudson)
Related merge proposals:
  https://code.launchpad.net/~mwhudson/lava-scheduler/health-unknown-action/+merge/97121
  proposed by: Michael Hudson-Doyle (mwhudson)
  review: Approve - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 146 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Tue 2012-03-13 14:02:45 +1300
message:
  Add an admin action to put all passing boards into unknown health state, for use after a rollout.
modified:
  doc/changes.rst
  lava_scheduler_app/admin.py


--
lp:lava-scheduler
https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk

You are subscribed to branch lp:lava-scheduler.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'doc/changes.rst'
--- doc/changes.rst	2012-03-07 02:14:40 +0000
+++ doc/changes.rst	2012-03-13 00:24:38 +0000
@@ -10,6 +10,8 @@ 
   one page.
 * Make TestJob a restricted resource, and update views to reflect
   restrictions.
+* Add admin action to set the health_status of all boards with pass
+  status to unknown status -- for use after a rollout.
 
 
 .. _version_0_10.1:

=== modified file 'lava_scheduler_app/admin.py'
--- lava_scheduler_app/admin.py	2012-02-09 19:23:51 +0000
+++ lava_scheduler_app/admin.py	2012-03-13 00:21:57 +0000
@@ -18,8 +18,14 @@ 
             device.put_into_online_mode(request.user, "admin action")
 online_action.short_description = "take online"
 
+def health_unknown(modeladmin, request, queryset):
+    for device in queryset.filter(health_status=Device.HEALTH_PASS):
+        device.health_status = Device.HEALTH_UNKNOWN
+        device.save()
+health_unknown.short_description = "set health_status to unknown"
+
 class DeviceAdmin(admin.ModelAdmin):
-    actions = [online_action, offline_action]
+    actions = [online_action, offline_action, health_unknown]
     list_filter = ['device_type', 'status']
 
 admin.site.register(Device, DeviceAdmin)