switch from failure to anyhow
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
404d78c41e
commit
f7d4e4b506
@ -19,7 +19,7 @@ bytes = "0.5"
|
||||
chrono = "0.4" # Date and time library for Rust
|
||||
crc32fast = "1"
|
||||
endian_trait = { version = "0.6", features = ["arrays"] }
|
||||
failure = "0.1"
|
||||
anyhow = "1.0"
|
||||
futures = "0.3"
|
||||
h2 = { version = "0.2", features = ["stream"] }
|
||||
http = "0.2"
|
||||
@ -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.21", features = [ "sortable-macro", "api-macro" ] }
|
||||
proxmox = { version = "0.1.22", 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"
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
|
||||
use serde_json::{json, Value};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
|
||||
use proxmox::api::{api, Router, RpcEnvironment, Permission};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use serde_json::{json, Value};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::Error;
|
||||
|
||||
use serde_json::{json, Value};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::Value;
|
||||
|
||||
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
|
@ -2,7 +2,7 @@ use std::collections::{HashSet, HashMap};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use chrono::{TimeZone, Local};
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use futures::*;
|
||||
use hyper::http::request::Parts;
|
||||
use hyper::{header, Body, Response, StatusCode};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use futures::*;
|
||||
use hyper::header::{HeaderValue, UPGRADE};
|
||||
use hyper::http::request::Parts;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
@ -2,7 +2,7 @@ use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use futures::*;
|
||||
use hyper::Body;
|
||||
use hyper::http::request::Parts;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::Value;
|
||||
|
||||
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::Value;
|
||||
|
||||
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use lazy_static::lazy_static;
|
||||
use openssl::sha;
|
||||
use regex::Regex;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
use std::io::{BufRead,BufReader};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, Router, Permission};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::{sortable, identity, list_subdirs_api_method};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::sys::linux::procfs;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::fs::File;
|
||||
use std::io::{BufRead, BufReader};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, Router, RpcEnvironment, Permission};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::mem::{self, MaybeUninit};
|
||||
|
||||
use chrono::prelude::*;
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, Router, Permission};
|
||||
|
@ -1,6 +1,6 @@
|
||||
//! Sync datastore from remote server
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use serde_json::json;
|
||||
use std::convert::TryFrom;
|
||||
use std::sync::Arc;
|
||||
|
@ -1,5 +1,5 @@
|
||||
//use chrono::{Local, TimeZone};
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use futures::*;
|
||||
use hyper::header::{self, HeaderValue, UPGRADE};
|
||||
use hyper::http::request::Parts;
|
||||
|
@ -1,4 +1,4 @@
|
||||
//use failure::*;
|
||||
//use anyhow::{bail, format_err, Error};
|
||||
use std::sync::Arc;
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, Router, Permission};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail};
|
||||
use ::serde::{Deserialize, Serialize};
|
||||
|
||||
use proxmox::api::{api, schema::*};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{ApiHandler, ApiMethod, Router, RpcEnvironment, Permission};
|
||||
|
@ -7,7 +7,7 @@ use std::io::Write;
|
||||
use std::ffi::{CString, CStr};
|
||||
|
||||
use base64;
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use serde_json::json;
|
||||
|
||||
pub trait ProxmoxAuthenticator {
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
use openssl::rsa::{Rsa};
|
||||
|
@ -103,7 +103,7 @@
|
||||
//!
|
||||
//! Not sure if this is better. TODO
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
|
||||
// Note: .pcat1 => Proxmox Catalog Format version 1
|
||||
pub const CATALOG_NAME: &str = "catalog.pcat1.didx";
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::tools;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use regex::Regex;
|
||||
use std::os::unix::io::RawFd;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use std::fmt;
|
||||
use std::ffi::{CStr, CString, OsStr};
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
|
@ -7,7 +7,7 @@ use std::os::unix::ffi::OsStrExt;
|
||||
use std::path::{Component, Path, PathBuf};
|
||||
|
||||
use chrono::{Utc, offset::TimeZone};
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use nix::sys::stat::{Mode, SFlag};
|
||||
|
||||
use proxmox::api::{cli::*, *};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use std::sync::Arc;
|
||||
use std::io::Read;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
use std::io::Write;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use super::CryptConfig;
|
||||
use crate::tools::borrow::Tied;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::io::Write;
|
||||
|
@ -2,7 +2,7 @@ use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use bytes::BytesMut;
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use futures::ready;
|
||||
use futures::stream::{Stream, TryStream};
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
//! See the Wikipedia Artikel for [Authenticated
|
||||
//! encryption](https://en.wikipedia.org/wiki/Authenticated_encryption)
|
||||
//! for a short introduction.
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use openssl::pkcs5::pbkdf2_hmac;
|
||||
use openssl::hash::MessageDigest;
|
||||
use openssl::symm::{decrypt_aead, Cipher, Crypter, Mode};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use std::sync::Arc;
|
||||
use std::io::{Read, BufRead};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use std::sync::Arc;
|
||||
use std::io::Write;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use std::convert::TryInto;
|
||||
|
||||
use proxmox::tools::io::{ReadExt, WriteExt};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use std::sync::Arc;
|
||||
use std::io::{Read, BufReader};
|
||||
use proxmox::tools::io::ReadExt;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use std::sync::Arc;
|
||||
use std::io::{Write, Seek, SeekFrom};
|
||||
use proxmox::tools::io::WriteExt;
|
||||
|
@ -3,7 +3,7 @@ use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use lazy_static::lazy_static;
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
|
@ -5,7 +5,7 @@ use std::os::unix::io::AsRawFd;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
|
||||
use proxmox::tools::io::ReadExt;
|
||||
use proxmox::tools::uuid::Uuid;
|
||||
@ -275,7 +275,7 @@ struct ChunkCacher<'a, S> {
|
||||
}
|
||||
|
||||
impl<'a, S: ReadChunk> crate::tools::lru_cache::Cacher<usize, (u64, u64, Vec<u8>)> for ChunkCacher<'a, S> {
|
||||
fn fetch(&mut self, index: usize) -> Result<Option<(u64, u64, Vec<u8>)>, failure::Error> {
|
||||
fn fetch(&mut self, index: usize) -> Result<Option<(u64, u64, Vec<u8>)>, anyhow::Error> {
|
||||
let (start, end, digest) = self.index.chunk_info(index)?;
|
||||
self.store.read_chunk(&digest).and_then(|data| Ok(Some((start, end, data))))
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use std::convert::TryInto;
|
||||
use std::io::{Seek, SeekFrom};
|
||||
|
||||
|
@ -3,7 +3,7 @@ use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use failure::*;
|
||||
use anyhow::{format_err, Error};
|
||||
use futures::*;
|
||||
|
||||
/// Trait to get digest list from index files
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use chrono::{Local, TimeZone, DateTime};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use std::convert::TryFrom;
|
||||
use std::path::Path;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::path::PathBuf;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use std::sync::Arc;
|
||||
|
||||
use super::datastore::*;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
// chacha20-poly1305
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use proxmox::api::{*, cli::*};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::io::Write;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use proxmox::api::format::*;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use proxmox::api::format::*;
|
||||
use proxmox::api::cli::*;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use proxmox::api::format::dump_api;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
|
||||
use std::thread;
|
||||
use std::path::PathBuf;
|
||||
|
@ -2,7 +2,7 @@ use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use futures::future::TryFutureExt;
|
||||
use futures::stream::Stream;
|
||||
use tokio::net::TcpStream;
|
||||
|
@ -2,7 +2,7 @@ use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{format_err, Error};
|
||||
use futures::future::TryFutureExt;
|
||||
use futures::stream::Stream;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{format_err, Error};
|
||||
use futures::*;
|
||||
use hyper::{Request, Response, Body};
|
||||
use openssl::ssl::{SslMethod, SslAcceptor, SslFiletype};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use futures::*;
|
||||
|
||||
// Simple H2 server to test H2 speed with h2client.rs
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use futures::*;
|
||||
|
||||
use proxmox::try_block;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use nix::unistd::{fork, ForkResult, pipe};
|
||||
use std::os::unix::io::RawFd;
|
||||
use chrono::{Local, DateTime, Utc, TimeZone};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use proxmox::api::{api, cli::*, RpcEnvironment, ApiHandler};
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use futures::*;
|
||||
use hyper;
|
||||
use openssl::ssl::{SslMethod, SslAcceptor, SslFiletype};
|
||||
|
@ -1,6 +1,6 @@
|
||||
extern crate proxmox_backup;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{format_err, Error};
|
||||
|
||||
use proxmox::{sortable, identity};
|
||||
use proxmox::api::{ApiHandler, ApiMethod, RpcEnvironment};
|
||||
|
@ -2,7 +2,7 @@ extern crate proxmox_backup;
|
||||
|
||||
// also see https://www.johndcook.com/blog/standard_deviation/
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use std::io::{Read, Write};
|
||||
|
||||
use proxmox_backup::backup::*;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use futures::*;
|
||||
|
||||
extern crate proxmox_backup;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use proxmox_backup::client::*;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{format_err, Error};
|
||||
use std::io::{Read, Write, Seek, SeekFrom};
|
||||
use std::fs::File;
|
||||
use std::sync::Arc;
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::fmt;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{format_err, Error};
|
||||
|
||||
use proxmox::api::schema::*;
|
||||
use proxmox::const_regex;
|
||||
|
@ -2,7 +2,7 @@ use std::collections::HashSet;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{format_err, Error};
|
||||
use chrono::{DateTime, Utc};
|
||||
use futures::*;
|
||||
use futures::stream::Stream;
|
||||
|
@ -3,7 +3,7 @@ use std::task::{Context, Poll};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use chrono::Utc;
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use futures::*;
|
||||
use http::Uri;
|
||||
use http::header::HeaderValue;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use futures::*;
|
||||
|
||||
use crate::backup::ChunkInfo;
|
||||
|
@ -6,7 +6,7 @@ use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use bytes::Bytes;
|
||||
use failure::*;
|
||||
use anyhow::{format_err, Error};
|
||||
use futures::{ready, Future};
|
||||
use h2::SendStream;
|
||||
|
||||
|
@ -7,7 +7,7 @@ use std::sync::{Arc, Mutex};
|
||||
use std::task::{Context, Poll};
|
||||
use std::thread;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{format_err, Error};
|
||||
use futures::stream::Stream;
|
||||
|
||||
use nix::fcntl::OFlag;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use std::thread;
|
||||
use std::os::unix::io::FromRawFd;
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use super::BackupReader;
|
||||
use crate::backup::{ReadChunk, DataBlob, CryptConfig};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use serde_json::json;
|
||||
|
||||
use super::HttpClient;
|
||||
|
@ -3,7 +3,7 @@
|
||||
//! This library contains helper to read, parse and write the
|
||||
//! configuration files.
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use std::path::PathBuf;
|
||||
use nix::sys::stat::Mode;
|
||||
use openssl::rsa::{Rsa};
|
||||
|
@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet, BTreeMap, BTreeSet};
|
||||
use std::path::{PathBuf, Path};
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
@ -520,7 +520,7 @@ pub fn save_config(acl: &AclTree) -> Result<(), Error> {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use super::AclTree;
|
||||
|
||||
fn check_roles(
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use proxmox::api::section_config::SectionConfigData;
|
||||
use proxmox::api::UserInformation;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use lazy_static::lazy_static;
|
||||
use std::collections::HashMap;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use lazy_static::lazy_static;
|
||||
use std::collections::HashMap;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use lazy_static::lazy_static;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde_json::json;
|
||||
|
@ -3,7 +3,7 @@
|
||||
//! A file list catalog simply store a directory tree. Such catalogs
|
||||
//! may be used as index to do a fast search for files.
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use std::ffi::CStr;
|
||||
|
||||
pub trait BackupCatalogWriter {
|
||||
|
@ -8,7 +8,7 @@ use std::io::{Read, Seek, SeekFrom};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use libc;
|
||||
|
||||
use super::binary_search_tree::search_binary_tree_by;
|
||||
|
@ -2,7 +2,7 @@ use std::ffi::{OsStr, OsString};
|
||||
use std::os::unix::io::{AsRawFd, RawFd};
|
||||
use std::path::PathBuf;
|
||||
|
||||
use failure::{format_err, Error};
|
||||
use anyhow::{format_err, Error};
|
||||
use nix::errno::Errno;
|
||||
use nix::fcntl::OFlag;
|
||||
use nix::sys::stat::Mode;
|
||||
|
@ -10,7 +10,7 @@ use std::os::unix::io::RawFd;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use endian_trait::Endian;
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use nix::errno::Errno;
|
||||
use nix::fcntl::OFlag;
|
||||
use nix::sys::stat::FileStat;
|
||||
|
@ -7,7 +7,7 @@
|
||||
use std::cmp::Ordering;
|
||||
|
||||
use endian_trait::Endian;
|
||||
use failure::{bail, Error};
|
||||
use anyhow::{bail, Error};
|
||||
use siphasher::sip::SipHasher24;
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@ use std::os::unix::ffi::OsStrExt;
|
||||
use std::path::Path;
|
||||
use std::sync::Mutex;
|
||||
|
||||
use failure::{bail, format_err, Error};
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use libc;
|
||||
use libc::{c_char, c_int, c_void, size_t};
|
||||
|
||||
|
@ -10,7 +10,7 @@ use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::os::unix::io::{FromRawFd, RawFd};
|
||||
|
||||
use failure::{bail, Error};
|
||||
use anyhow::{bail, Error};
|
||||
use libc::{c_char, c_int};
|
||||
use nix::errno::Errno;
|
||||
use nix::fcntl;
|
||||
@ -44,7 +44,7 @@ pub enum MatchType {
|
||||
/// ```
|
||||
/// # use std::ffi::CString;
|
||||
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchType};
|
||||
/// # fn main() -> Result<(), failure::Error> {
|
||||
/// # fn main() -> Result<(), anyhow::Error> {
|
||||
/// let filename = CString::new("some.conf")?;
|
||||
/// let is_dir = false;
|
||||
///
|
||||
@ -223,7 +223,7 @@ impl<'a> MatchPatternSlice<'a> {
|
||||
/// original pattern.
|
||||
/// ```
|
||||
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchPatternSlice, MatchType};
|
||||
/// # fn main() -> Result<(), failure::Error> {
|
||||
/// # fn main() -> Result<(), anyhow::Error> {
|
||||
/// let pattern = MatchPattern::from_line(b"some/match/pattern/")?.unwrap();
|
||||
/// let slice = pattern.as_slice();
|
||||
/// let front = slice.get_front_pattern();
|
||||
@ -246,7 +246,7 @@ impl<'a> MatchPatternSlice<'a> {
|
||||
/// If no slash is encountered, the `MatchPatternSlice` will be empty.
|
||||
/// ```
|
||||
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchPatternSlice, MatchType};
|
||||
/// # fn main() -> Result<(), failure::Error> {
|
||||
/// # fn main() -> Result<(), anyhow::Error> {
|
||||
/// let pattern = MatchPattern::from_line(b"some/match/pattern/")?.unwrap();
|
||||
/// let slice = pattern.as_slice();
|
||||
/// let rest = slice.get_rest_pattern();
|
||||
@ -379,7 +379,7 @@ impl<'a> MatchPatternSlice<'a> {
|
||||
/// ```
|
||||
/// # use std::ffi::CString;
|
||||
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchPatternSlice, MatchType};
|
||||
/// # fn main() -> Result<(), failure::Error> {
|
||||
/// # fn main() -> Result<(), anyhow::Error> {
|
||||
/// let patterns = vec![
|
||||
/// MatchPattern::from_line(b"some/match/pattern/")?.unwrap(),
|
||||
/// MatchPattern::from_line(b"to_match/")?.unwrap()
|
||||
@ -454,7 +454,7 @@ impl<'a> MatchPatternSlice<'a> {
|
||||
/// ```
|
||||
/// # use std::ffi::CString;
|
||||
/// # use self::proxmox_backup::pxar::{MatchPattern, MatchPatternSlice, MatchType};
|
||||
/// # fn main() -> Result<(), failure::Error> {
|
||||
/// # fn main() -> Result<(), anyhow::Error> {
|
||||
/// let patterns = vec![
|
||||
/// MatchPattern::from_line(b"some/match/pattern/")?.unwrap(),
|
||||
/// MatchPattern::from_line(b"to_match/")?.unwrap()
|
||||
|
@ -11,7 +11,7 @@ use std::os::unix::io::RawFd;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use endian_trait::Endian;
|
||||
use failure::{bail, format_err, Error};
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use nix::errno::Errno;
|
||||
use nix::fcntl::OFlag;
|
||||
use nix::sys::stat::Mode;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
|
||||
use futures::*;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
use hyper::{Body, Response, StatusCode};
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
@ -6,7 +6,7 @@ use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use std::task::{Context, Poll};
|
||||
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use futures::future::{self, FutureExt, TryFutureExt};
|
||||
use futures::stream::TryStreamExt;
|
||||
use hyper::header;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{Error};
|
||||
use lazy_static::lazy_static;
|
||||
use std::sync::Mutex;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use failure::*;
|
||||
use anyhow::{bail, Error};
|
||||
use lazy_static::lazy_static;
|
||||
use regex::Regex;
|
||||
use chrono::Local;
|
||||
|
@ -6,7 +6,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use chrono::Local;
|
||||
use failure::*;
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use futures::*;
|
||||
use lazy_static::lazy_static;
|
||||
use nix::unistd::Pid;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user