[pbs-devel] [PATCH proxmox-backup 01/10] api2/node/tasks: move userfilter to function signature

Dominik Csapak d.csapak at proxmox.com
Fri Sep 25 16:13:17 CEST 2020


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/api2/node/tasks.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/api2/node/tasks.rs b/src/api2/node/tasks.rs
index c8add6b4..e6a58a82 100644
--- a/src/api2/node/tasks.rs
+++ b/src/api2/node/tasks.rs
@@ -303,6 +303,7 @@ pub fn list_tasks(
     limit: u64,
     errors: bool,
     running: bool,
+    userfilter: Option<String>,
     param: Value,
     mut rpcenv: &mut dyn RpcEnvironment,
 ) -> Result<Vec<TaskListItem>, Error> {
@@ -315,7 +316,6 @@ pub fn list_tasks(
 
     let store = param["store"].as_str();
 
-    let userfilter = param["userfilter"].as_str();
 
     let list = server::read_task_list()?;
 
@@ -327,7 +327,7 @@ pub fn list_tasks(
         if !list_all && info.upid.userid != userid { continue; }
 
 
-        if let Some(userid) = userfilter {
+        if let Some(userid) = &userfilter {
             if !info.upid.userid.as_str().contains(userid) { continue; }
         }
 
-- 
2.20.1






More information about the pbs-devel mailing list