worker_state: move tasktype() code to src/api2/node/tasks.rs
Because this is API related code, and only used there. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
e678a50ea1
commit
fd18775ac1
@ -18,7 +18,7 @@ use proxmox::tools::fs::{create_path, replace_file, CreateOptions};
|
||||
|
||||
use pbs_buildcfg;
|
||||
use pbs_tools::logrotate::{LogRotate, LogRotateFiles};
|
||||
use pbs_api_types::{Authid, TaskStateType, UPID};
|
||||
use pbs_api_types::{Authid, UPID};
|
||||
use pbs_config::{open_backup_lockfile, BackupLockGuard};
|
||||
use proxmox_rest_server::{CommandoSocket, FileLogger, FileLogOptions};
|
||||
|
||||
@ -243,15 +243,6 @@ impl TaskState {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tasktype(&self) -> TaskStateType {
|
||||
match self {
|
||||
TaskState::OK { .. } => TaskStateType::OK,
|
||||
TaskState::Unknown { .. } => TaskStateType::Unknown,
|
||||
TaskState::Error { .. } => TaskStateType::Error,
|
||||
TaskState::Warning { .. } => TaskStateType::Warning,
|
||||
}
|
||||
}
|
||||
|
||||
fn result_text(&self) -> String {
|
||||
match self {
|
||||
TaskState::Error { message, .. } => format!("TASK ERROR: {}", message),
|
||||
|
Reference in New Issue
Block a user