]> git.proxmox.com Git - proxmox-backup.git/commitdiff
bump proxmox crate to 0.1.7
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 21 Jan 2020 11:28:01 +0000 (12:28 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 21 Jan 2020 12:48:37 +0000 (13:48 +0100)
The -sys, -tools and -api crate have now been merged into
the proxmx crate directly. Only macro crates are separate
(but still reexported by the proxmox crate in their
designated locations).

When we need to depend on "parts" of the crate later on
we'll just have to use features.

The reason is mostly that these modules had
inter-dependencies which really make them not independent
enough to be their own crates.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
33 files changed:
Cargo.toml
src/api2.rs
src/api2/access.rs
src/api2/admin.rs
src/api2/admin/datastore.rs
src/api2/backup.rs
src/api2/backup/upload_chunk.rs
src/api2/config.rs
src/api2/node.rs
src/api2/node/dns.rs
src/api2/node/services.rs
src/api2/node/status.rs
src/api2/node/tasks.rs
src/api2/pull.rs
src/api2/reader.rs
src/api2/types.rs
src/auth_helpers.rs
src/backup/data_blob.rs
src/backup/dynamic_index.rs
src/backup/fixed_index.rs
src/backup/key_derivation.rs
src/backup/manifest.rs
src/bin/proxmox-backup-api.rs
src/bin/proxmox-backup-client.rs
src/bin/proxmox-backup-manager.rs
src/bin/proxmox-backup-proxy.rs
src/client/backup_repo.rs
src/config.rs
src/section_config.rs
src/server/h2service.rs
src/server/rest.rs
src/server/worker_task.rs
src/tools/tty.rs

index 076fe0cac099e43419faaae6c4bfb758b639d7bc..09851309fc1301ac62ba8829f908d932c3d2b52b 100644 (file)
@@ -34,7 +34,7 @@ pam = "0.7"
 pam-sys = "0.5"
 percent-encoding = "2.1"
 pin-utils = "0.1.0-alpha"
-proxmox = { version = "0.1.5", features = [ "sortable-macro", "api-macro" ] }
+proxmox = { version = "0.1.7", features = [ "sortable-macro", "api-macro" ] }
 #proxmox = { git = "ssh://gitolite3@proxdev.maurer-it.com/rust/proxmox", version = "0.1.2", features = [ "sortable-macro", "api-macro" ] }
 #proxmox = { path = "../proxmox/proxmox", features = [ "sortable-macro", "api-macro" ] }
 regex = "1.2"
index 46c08a408db207550fc353505295d82e9ecf1baf..31c9d8e71cc31145e0a494283124f8fa94bb0af2 100644 (file)
@@ -9,9 +9,9 @@ pub mod types;
 pub mod version;
 pub mod pull;
 
-use proxmox::api::list_subdirs_api_method;
 use proxmox::api::router::SubdirMap;
 use proxmox::api::Router;
+use proxmox::list_subdirs_api_method;
 
 const NODES_ROUTER: Router = Router::new().match_all("node", &node::ROUTER);
 
index 8016b6b6c09e95450729595b69436c3f6e9aad8d..13692a19c0161138d8ad1a028b2953da85ca8aa1 100644 (file)
@@ -2,10 +2,10 @@ use failure::*;
 
 use serde_json::{json, Value};
 
-use proxmox::sortable;
-use proxmox::api::{http_err, list_subdirs_api_method};
-use proxmox::api::router::{Router, SubdirMap};
 use proxmox::api::api;
+use proxmox::api::router::{Router, SubdirMap};
+use proxmox::sortable;
+use proxmox::{http_err, list_subdirs_api_method};
 
 use crate::tools;
 use crate::tools::ticket::*;
index e782d68ca951f8c5d974d4699ce4c43455e0005f..189a2a11e6ebe5afa29c344545915981afddbce6 100644 (file)
@@ -1,5 +1,5 @@
 use proxmox::api::router::{Router, SubdirMap};
-use proxmox::api::list_subdirs_api_method;
+use proxmox::list_subdirs_api_method;
 
 pub mod datastore;
 
index 9487bcf49b26c3d4811d8875cca1f4dc3ec042a4..7d88c57d6f27154fc3134090087c660b0297250b 100644 (file)
@@ -7,14 +7,13 @@ use hyper::http::request::Parts;
 use hyper::{header, Body, Response, StatusCode};
 use serde_json::{json, Value};
 
-use proxmox::{sortable, identity};
 use proxmox::api::api;
-use proxmox::api::{http_err, list_subdirs_api_method};
 use proxmox::api::{ApiResponseFuture, ApiHandler, ApiMethod, Router, RpcEnvironment, RpcEnvironmentType};
 use proxmox::api::router::SubdirMap;
 use proxmox::api::schema::*;
-use proxmox::tools::try_block;
 use proxmox::tools::fs::{file_get_contents, replace_file, CreateOptions};
+use proxmox::try_block;
+use proxmox::{http_err, identity, list_subdirs_api_method, sortable};
 
 use crate::api2::types::*;
 use crate::backup::*;
index 894d7c13e011c8cb72bba90bab4e686ccf677431..5e4b4238b6e8f6c35bdc077079e030ef8c1fb1fc 100644 (file)
@@ -5,8 +5,7 @@ use hyper::http::request::Parts;
 use hyper::{Body, Response, StatusCode};
 use serde_json::{json, Value};
 
-use proxmox::{sortable, identity};
-use proxmox::api::list_subdirs_api_method;
+use proxmox::{sortable, identity, list_subdirs_api_method};
 use proxmox::api::{ApiResponseFuture, ApiHandler, ApiMethod, Router, RpcEnvironment};
 use proxmox::api::router::SubdirMap;
 use proxmox::api::schema::*;
index 1bc8c7d816838b5eca1b03ad5bb7210902364f0c..3fc457b0f67b6d39a0cd0162807631628ca273f7 100644 (file)
@@ -58,7 +58,7 @@ impl Future for UploadChunk {
                             break format_err!("uploaded chunk has unexpected size.");
                         }
 
-                        let (is_duplicate, compressed_size) = match proxmox::tools::try_block! {
+                        let (is_duplicate, compressed_size) = match proxmox::try_block! {
                             let mut chunk = DataBlob::from_raw(raw_data)?;
 
                             chunk.verify_unencrypted(this.size as usize, &this.digest)?;
index a6fef19ae1e4357dfb261f9d073139d034f27162..79db82da48dff7f9b6c78a34dbe2f6e4783322a6 100644 (file)
@@ -1,5 +1,5 @@
 use proxmox::api::router::{Router, SubdirMap};
-use proxmox::api::list_subdirs_api_method;
+use proxmox::list_subdirs_api_method;
 
 pub mod datastore;
 pub mod remote;
index b8bcd6cdc580765f0882917a9132417c1d92ecc9..b63197c9fb53797cdd6db884c3eb968426e5b3cb 100644 (file)
@@ -1,5 +1,5 @@
 use proxmox::api::router::{Router, SubdirMap};
-use proxmox::api::list_subdirs_api_method;
+use proxmox::list_subdirs_api_method;
 
 mod tasks;
 mod time;
index 46fd01f758166edb35cb7a58f9d3c5f907236837..fe69e1e9a463cdc59cfbe1f006a7f366880152ae 100644 (file)
@@ -10,7 +10,7 @@ use proxmox::{sortable, identity};
 use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
 use proxmox::api::schema::*;
 use proxmox::tools::fs::{file_get_contents, replace_file, CreateOptions};
-use proxmox::tools::*; // required to use IPRE!() macro ???
+use proxmox::{IPRE, IPV4RE, IPV6RE, IPV4OCTET, IPV6H16, IPV6LS32};
 
 use crate::api2::types::*;
 
index 56c642485610f8dbe40aa73456dff23aaa1b3c3a..aedfe0b36f6add8a93b7eb0be1e5f96f3d90647a 100644 (file)
@@ -3,8 +3,7 @@ use std::process::{Command, Stdio};
 use failure::*;
 use serde_json::{json, Value};
 
-use proxmox::{sortable, identity};
-use proxmox::api::list_subdirs_api_method;
+use proxmox::{sortable, identity, list_subdirs_api_method};
 use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
 use proxmox::api::router::SubdirMap;
 use proxmox::api::schema::*;
index 7013cf4b34d7f339b2a8084267a8682d5fd9a702..9bdf256c0f08685123f916c222ce7cdb8b038fd5 100644 (file)
@@ -4,7 +4,7 @@ use serde_json::{json, Value};
 use proxmox::sys::linux::procfs;
 
 use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, SubdirMap};
-use proxmox::api::list_subdirs_api_method;
+use proxmox::list_subdirs_api_method;
 
 use crate::api2::types::*;
 
index b725f35d59431a38cb9142d6858ee5e9f8cae798..3abab40b571301fe9f766458e910e5ea3c22b8b4 100644 (file)
@@ -4,11 +4,10 @@ use std::io::{BufRead, BufReader};
 use failure::*;
 use serde_json::{json, Value};
 
-use proxmox::{sortable, identity};
-use proxmox::api::list_subdirs_api_method;
 use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment};
 use proxmox::api::router::SubdirMap;
 use proxmox::api::schema::*;
+use proxmox::{identity, list_subdirs_api_method, sortable};
 
 use crate::tools;
 use crate::api2::types::*;
index e2368db63999f86adec363edcca752bced2c74d7..a5e64548f63a59e69f709f4bcc9d1a08effb494e 100644 (file)
@@ -128,7 +128,7 @@ async fn pull_snapshot(
     tmp_manifest_blob.verify_crc()?;
 
     if manifest_name.exists() {
-        let manifest_blob = proxmox::tools::try_block!({
+        let manifest_blob = proxmox::try_block!({
             let mut manifest_file = std::fs::File::open(&manifest_name)
                 .map_err(|err| format_err!("unable to open local manifest {:?} - {}", manifest_name, err))?;
 
@@ -331,7 +331,7 @@ pub async fn pull_store(
     }
 
     if delete {
-        let result: Result<(), Error> = proxmox::tools::try_block!({
+        let result: Result<(), Error> = proxmox::try_block!({
             let local_groups = BackupGroup::list_groups(&tgt_store.base_path())?;
             for local_group in local_groups {
                 if new_groups.contains(&local_group) { continue; }
index 130fe7ba74fa32fc81c4188ee9d2bf14375fa0f1..4a7aa680ae57fe5b97189f0832c86fcd0ae150d9 100644 (file)
@@ -7,9 +7,9 @@ use hyper::{Body, Response, StatusCode};
 use serde_json::Value;
 
 use proxmox::{sortable, identity};
-use proxmox::api::http_err;
 use proxmox::api::{ApiResponseFuture, ApiHandler, ApiMethod, Router, RpcEnvironment};
 use proxmox::api::schema::*;
+use proxmox::http_err;
 
 use crate::api2::types::*;
 use crate::backup::*;
index 8a3d6ea4fe45c90d49ee86c4e6361f454f0e2e67..16646ca62c351f69a2ed175eea42aa92be8ad44a 100644 (file)
@@ -1,8 +1,9 @@
 use failure::*;
 use ::serde::{Deserialize, Serialize};
 
-use proxmox::api::{api, const_regex, schema::*};
-use proxmox::tools::*; // required to use IPRE!() macro ???
+use proxmox::api::{api, schema::*};
+use proxmox::const_regex;
+use proxmox::{IPRE, IPV4RE, IPV6RE, IPV4OCTET, IPV6H16, IPV6LS32};
 
 // File names: may not contain slashes, may not start with "."
 pub const FILENAME_FORMAT: ApiStringFormat = ApiStringFormat::VerifyFn(|name| {
index 5382da27a7105447db4156d4f76fc20a5493d3ed..bca58bdfea1fbe8728e4ff7e2f05995cf5411f7c 100644 (file)
@@ -7,10 +7,8 @@ use openssl::sha;
 
 use std::path::PathBuf;
 
-use proxmox::tools::{
-    try_block,
-    fs::{file_get_contents, replace_file, CreateOptions},
-};
+use proxmox::tools::fs::{file_get_contents, replace_file, CreateOptions};
+use proxmox::try_block;
 
 fn compute_csrf_secret_digest(
     timestamp: i64,
index 925e9ce6dbd89b9eab4532eb95dff7373a2a7a8f..3a5a05e0dbd0ecda64169e4a3b1f277777c13cd3 100644 (file)
@@ -48,13 +48,13 @@ impl DataBlob {
 
     /// accessor to crc32 checksum
     pub fn crc(&self) -> u32 {
-        let crc_o = proxmox::tools::offsetof!(DataBlobHeader, crc);
+        let crc_o = proxmox::offsetof!(DataBlobHeader, crc);
         u32::from_le_bytes(self.raw_data[crc_o..crc_o+4].try_into().unwrap())
     }
 
     // set the CRC checksum field
     pub fn set_crc(&mut self, crc: u32) {
-        let crc_o = proxmox::tools::offsetof!(DataBlobHeader, crc);
+        let crc_o = proxmox::offsetof!(DataBlobHeader, crc);
         self.raw_data[crc_o..crc_o+4].copy_from_slice(&crc.to_le_bytes());
     }
 
index af848e93b0958e35c8f4b57a3757a0af68963290..0a993d345eea9db160c145abdcf649c8ff713d27 100644 (file)
@@ -29,7 +29,7 @@ pub struct DynamicIndexHeader {
     pub index_csum: [u8; 32],
     reserved: [u8; 4032], // overall size is one page (4096 bytes)
 }
-proxmox::tools::static_assert_size!(DynamicIndexHeader, 4096);
+proxmox::static_assert_size!(DynamicIndexHeader, 4096);
 // TODO: Once non-Copy unions are stabilized, use:
 // union DynamicIndexHeader {
 //     reserved: [u8; 4096],
@@ -493,7 +493,7 @@ impl DynamicIndexWriter {
 
         self.writer.flush()?;
 
-        let csum_offset = proxmox::tools::offsetof!(DynamicIndexHeader, index_csum);
+        let csum_offset = proxmox::offsetof!(DynamicIndexHeader, index_csum);
         self.writer.seek(SeekFrom::Start(csum_offset as u64))?;
 
         let csum = self.csum.take().unwrap();
index db0c52d0b16b88176f922c502213890c28980669..d372632004f05578f403235b8b4b3174cecc10b2 100644 (file)
@@ -32,7 +32,7 @@ pub struct FixedIndexHeader {
     pub chunk_size: u64,
     reserved: [u8; 4016], // overall size is one page (4096 bytes)
 }
-proxmox::tools::static_assert_size!(FixedIndexHeader, 4096);
+proxmox::static_assert_size!(FixedIndexHeader, 4096);
 
 // split image into fixed size chunks
 
@@ -372,7 +372,7 @@ impl FixedIndexWriter {
 
         self.unmap()?;
 
-        let csum_offset = proxmox::tools::offsetof!(FixedIndexHeader, index_csum);
+        let csum_offset = proxmox::offsetof!(FixedIndexHeader, index_csum);
         self.file.seek(SeekFrom::Start(csum_offset as u64))?;
         self.file.write_all(&index_csum)?;
         self.file.flush()?;
index 45c464aa11d1429687df84e805c73ac0429f99db..547eed96fdfa2ba2cf977097fc15a08923be21a3 100644 (file)
@@ -3,10 +3,8 @@ use failure::*;
 use serde::{Deserialize, Serialize};
 use chrono::{Local, TimeZone, DateTime};
 
-use proxmox::tools::{
-    try_block,
-    fs::{file_get_contents, replace_file, CreateOptions},
-};
+use proxmox::tools::fs::{file_get_contents, replace_file, CreateOptions};
+use proxmox::try_block;
 
 #[derive(Deserialize, Serialize, Debug)]
 pub enum KeyDerivationConfig {
index c1e66de1a5b326ae382ae744f21b46d8a2325bef..ca588f9b6229c386fa292859d9a5686f194d418e 100644 (file)
@@ -119,7 +119,7 @@ impl TryFrom<Value> for BackupManifest {
 
         use crate::tools::{required_string_property, required_integer_property, required_array_property};
 
-        proxmox::tools::try_block!({
+        proxmox::try_block!({
             let backup_type = required_string_property(&data, "backup-type")?;
             let backup_id = required_string_property(&data, "backup-id")?;
             let backup_time = required_integer_property(&data, "backup-time")?;
index a1ac399ab160c0cd682dd14cf0f6f01adeae6a26..4dca9bcb5e43242a5b2d715e4f82f75075c3ca69 100644 (file)
@@ -1,7 +1,7 @@
 use failure::*;
 use futures::*;
 
-use proxmox::tools::try_block;
+use proxmox::try_block;
 use proxmox::api::RpcEnvironmentType;
 
 //use proxmox_backup::tools;
index a73c3c8dee91b7c4b9750a06ca28e0297f198111..4acdb8f6f9223de1790c018323bb78b2de9df678 100644 (file)
@@ -35,7 +35,7 @@ use xdg::BaseDirectories;
 use futures::*;
 use tokio::sync::mpsc;
 
-proxmox::api::const_regex! {
+proxmox::const_regex! {
     BACKUPSPEC_REGEX = r"^([a-zA-Z0-9_-]+\.(?:pxar|img|conf|log)):(.+)$";
 }
 
index c076e66774c84d3cd8ab0df4425e98df222dff42..283e293d6b8713122505aac32a883d34fb9d8ecb 100644 (file)
@@ -467,7 +467,7 @@ pub fn complete_remote_datastore_name(_arg: &str, param: &HashMap<String, String
 
     let mut list = Vec::new();
 
-    let _ = proxmox::tools::try_block!({
+    let _ = proxmox::try_block!({
         let remote = param.get("remote").ok_or_else(|| format_err!("no remote"))?;
         let (remote_config, _digest) = remote::config()?;
 
index fdd54cadff2274c2d1e2731ac7622a41ac47c2b5..82e7af9af837b6e2ca2452a8391c1ea2090d4d9b 100644 (file)
@@ -5,7 +5,7 @@ use futures::*;
 use hyper;
 use openssl::ssl::{SslMethod, SslAcceptor, SslFiletype};
 
-use proxmox::tools::try_block;
+use proxmox::try_block;
 use proxmox::api::RpcEnvironmentType;
 
 use proxmox_backup::configdir;
index 525da9093219f342ca632e86e366800cfe71cc90..116f349bf027ab7602f894c1919bcfc15049f092 100644 (file)
@@ -2,8 +2,8 @@ use std::fmt;
 
 use failure::*;
 
-use proxmox::api::const_regex;
 use proxmox::api::schema::*;
+use proxmox::const_regex;
 
 const_regex! {
     /// Regular expression to parse repository URLs
index acb74f23733675eb72d5f629d92c208d5d41f5a7..3d5f1c866d7d085a23c15d807e0b86d51f1f634c 100644 (file)
@@ -11,7 +11,7 @@ use openssl::x509::{X509Builder};
 use openssl::pkey::PKey;
 
 use proxmox::tools::fs::{CreateOptions, replace_file};
-use proxmox::tools::try_block;
+use proxmox::try_block;
 
 use crate::buildcfg;
 
index 7e553a62aba9947eb750009457917de264ae1f62..49a613ef7b2f928a248b48fd1d0f3dc42268eef2 100644 (file)
@@ -9,7 +9,7 @@ use serde::de::DeserializeOwned;
 use serde::ser::Serialize;
 
 use proxmox::api::schema::*;
-use proxmox::tools::try_block;
+use proxmox::try_block;
 
 pub struct SectionConfigPlugin {
     type_name: String,
index 982618d6466f2e718674b1368b1a97702836429d..8682dc8d48fe8f196eea975e818a9e3ccffd89d4 100644 (file)
@@ -7,7 +7,8 @@ use std::task::{Context, Poll};
 use futures::*;
 use hyper::{Body, Request, Response, StatusCode};
 
-use proxmox::api::{http_err, ApiResponseFuture, HttpError, Router, RpcEnvironment};
+use proxmox::api::{ApiResponseFuture, HttpError, Router, RpcEnvironment};
+use proxmox::http_err;
 
 use crate::tools;
 use crate::server::formatter::*;
index 54cef749ad68733b702729bad3346edd02efc783..5383fc77a06f875261cf61e055b27452e5c16734 100644 (file)
@@ -17,7 +17,7 @@ use tokio::fs::File;
 use tokio::time::Instant;
 use url::form_urlencoded;
 
-use proxmox::api::http_err;
+use proxmox::http_err;
 use proxmox::api::{ApiHandler, ApiMethod, HttpError};
 use proxmox::api::{RpcEnvironment, RpcEnvironmentType};
 use proxmox::api::schema::{ObjectSchema, parse_simple_value, verify_json_object, parse_parameter_strings};
index 6183cae35210322d08bd594701afb4976183c8cb..eb012f1ecfe45706f6af97b4e24740b6aab374d6 100644 (file)
@@ -14,10 +14,8 @@ use serde_json::{json, Value};
 use tokio::sync::oneshot;
 
 use proxmox::sys::linux::procfs;
-use proxmox::tools::{
-    try_block,
-    fs::{create_path, replace_file, CreateOptions},
-};
+use proxmox::try_block;
+use proxmox::tools::fs::{create_path, replace_file, CreateOptions};
 
 use super::UPID;
 
index 69b94264735769c977e74c8590f2208776d99eea..e37863acd48b5e88f1102f87c9697ba941ff8f56 100644 (file)
@@ -6,7 +6,7 @@ use std::os::unix::io::AsRawFd;
 
 use failure::*;
 
-use proxmox::tools::try_block;
+use proxmox::try_block;
 
 /// Returns whether the current stdin is a tty .
 pub fn stdin_isatty() -> bool {