From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id BFFA46B15E for ; Mon, 20 Sep 2021 09:38:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BB2B01C3A2 for ; Mon, 20 Sep 2021 09:38:18 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 4F5521C36B for ; Mon, 20 Sep 2021 09:38:17 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 293D0449AD; Mon, 20 Sep 2021 09:38:17 +0200 (CEST) From: Dietmar Maurer To: pbs-devel@lists.proxmox.com Date: Mon, 20 Sep 2021 09:38:03 +0200 Message-Id: <20210920073813.3178009-5-dietmar@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210920073813.3178009-1-dietmar@proxmox.com> References: <20210920073813.3178009-1-dietmar@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.661 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup 05/15] move src/server/formatter.rs to pbs-server crate X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Sep 2021 07:38:18 -0000 --- {src/server => pbs-server/src}/formatter.rs | 0 pbs-server/src/lib.rs | 1 + src/api2/admin/datastore.rs | 3 ++- src/api2/backup/environment.rs | 2 +- src/api2/reader/environment.rs | 2 +- src/server/h2service.rs | 3 ++- src/server/mod.rs | 2 -- src/server/rest.rs | 3 +-- 8 files changed, 8 insertions(+), 8 deletions(-) rename {src/server => pbs-server/src}/formatter.rs (100%) diff --git a/src/server/formatter.rs b/pbs-server/src/formatter.rs similarity index 100% rename from src/server/formatter.rs rename to pbs-server/src/formatter.rs diff --git a/pbs-server/src/lib.rs b/pbs-server/src/lib.rs index 42e78d89..bc8334ba 100644 --- a/pbs-server/src/lib.rs +++ b/pbs-server/src/lib.rs @@ -5,6 +5,7 @@ use anyhow::{bail, format_err, Error}; use proxmox::tools::fd::Fd; pub mod daemon; +pub mod formatter; mod environment; pub use environment::*; diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs index 690671a0..7c8becbf 100644 --- a/src/api2/admin/datastore.rs +++ b/src/api2/admin/datastore.rs @@ -54,6 +54,7 @@ use pbs_tools::blocking::WrappedReaderStream; use pbs_tools::stream::{AsyncReaderStream, AsyncChannelWriter}; use pbs_tools::json::{required_integer_param, required_string_param}; use pbs_config::CachedUserInfo; +use pbs_server::formatter; use crate::api2::node::rrd::create_value_from_rrd; use crate::backup::{ @@ -1326,7 +1327,7 @@ pub fn upload_backup_log( replace_file(&path, blob.raw_data(), CreateOptions::new())?; // fixme: use correct formatter - Ok(crate::server::formatter::json_response(Ok(Value::Null))) + Ok(formatter::json_response(Ok(Value::Null))) }.boxed() } diff --git a/src/api2/backup/environment.rs b/src/api2/backup/environment.rs index 1766639e..e599fd9a 100644 --- a/src/api2/backup/environment.rs +++ b/src/api2/backup/environment.rs @@ -15,10 +15,10 @@ use pbs_datastore::backup_info::{BackupDir, BackupInfo}; use pbs_datastore::dynamic_index::DynamicIndexWriter; use pbs_datastore::fixed_index::FixedIndexWriter; use pbs_api_types::Authid; +use pbs_server::formatter::*; use crate::backup::{verify_backup_dir_with_lock, DataStore}; use crate::server::WorkerTask; -use crate::server::formatter::*; use hyper::{Body, Response}; #[derive(Copy, Clone, Serialize)] diff --git a/src/api2/reader/environment.rs b/src/api2/reader/environment.rs index 64a01c4d..e001101c 100644 --- a/src/api2/reader/environment.rs +++ b/src/api2/reader/environment.rs @@ -7,9 +7,9 @@ use proxmox::api::{RpcEnvironment, RpcEnvironmentType}; use pbs_datastore::backup_info::BackupDir; use pbs_api_types::Authid; +use pbs_server::formatter::*; use crate::backup::DataStore; -use crate::server::formatter::*; use crate::server::WorkerTask; //use proxmox::tools; diff --git a/src/server/h2service.rs b/src/server/h2service.rs index 332b3b1a..bc9561d3 100644 --- a/src/server/h2service.rs +++ b/src/server/h2service.rs @@ -11,8 +11,9 @@ use hyper::{Body, Request, Response, StatusCode}; use proxmox::api::{ApiResponseFuture, HttpError, Router, RpcEnvironment}; use proxmox::http_err; +use pbs_server::formatter::*; + use crate::tools; -use crate::server::formatter::*; use crate::server::WorkerTask; /// Hyper Service implementation to handle stateful H2 connections. diff --git a/src/server/mod.rs b/src/server/mod.rs index 71db76af..fe6463b9 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -55,8 +55,6 @@ pub use worker_task::*; mod h2service; pub use h2service::*; -pub mod formatter; - #[macro_use] pub mod rest; diff --git a/src/server/rest.rs b/src/server/rest.rs index 1b95ce04..767ce85a 100644 --- a/src/server/rest.rs +++ b/src/server/rest.rs @@ -35,8 +35,7 @@ use pbs_tools::compression::{DeflateEncoder, Level}; use pbs_tools::stream::AsyncReaderStream; use pbs_api_types::{Authid, Userid}; use pbs_server::{ApiConfig, FileLogger, FileLogOptions, AuthError, RestEnvironment}; - -use super::formatter::*; +use pbs_server::formatter::*; use crate::auth_helpers::*; use pbs_config::CachedUserInfo; -- 2.30.2