diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2017-04-19 14:35:21 +0100 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2017-04-19 14:35:21 +0100 |
commit | e38412d398e1ad48edc80010eba81c369918d7c2 (patch) | |
tree | e83ffade1982ce540296421e7ad4c3ef925bf3e1 | |
parent | 1855e2ec6b5564c1f95e080c4d54129f539e4472 (diff) |
lava-job-list-mode: only process jobs on this panes server
-rw-r--r-- | lava-job-list-mode.el | 2 | ||||
-rw-r--r-- | lava-jobs.el | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lava-job-list-mode.el b/lava-job-list-mode.el index 34db077..dca4e25 100644 --- a/lava-job-list-mode.el +++ b/lava-job-list-mode.el @@ -154,7 +154,7 @@ Letters do not insert themselves; instead, they are commands. (defun lava-job-list-update-all () "Update the info hash of all jobs now." - (-each (-map 'car lava-job-info) + (-each (lava-jobs-get-all-on-host lava-host) (lambda (job) (let* ((info-hash (lava-jobs-get-hash job)) (jobid (gethash "job_id" info-hash))) diff --git a/lava-jobs.el b/lava-jobs.el index 26816dc..c4a4cfb 100644 --- a/lava-jobs.el +++ b/lava-jobs.el @@ -91,6 +91,13 @@ The optional `STATUS' sets that field up." "Return a list of all LAVA jobs in the system." (-map 'car lava-job-info)) +(defun lava-jobs-get-all-on-host (server) + "Return a list of all LAVA jobs for a given `SERVER'." + (let ((host-regex (rx-to-string `(: bos ,server eos)))) + (--filter + (string-match-p host-regex (lava-jobs-get-field it "lava_host")) + (-map 'car lava-job-info)))) + (defun lava-jobs-get-actual-device (job-id) "Return the actual device this job is running on, or nil" (let ((hostcache (or (lava-jobs-get-field job-id |