update to proxmox-sys 0.2 crate
- imported pbs-api-types/src/common_regex.rs from old proxmox crate - use hex crate to generate/parse hex digest - remove all reference to proxmox crate (use proxmox-sys and proxmox-serde instead) Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
		| @ -6,6 +6,7 @@ use std::path::Path; | ||||
| use anyhow::{bail, format_err, Error}; | ||||
| use serde_json::{json, Value}; | ||||
| use walkdir::WalkDir; | ||||
| use hex::FromHex; | ||||
|  | ||||
| use proxmox_router::cli::{ | ||||
|     format_and_print_result, get_output_format, CliCommand, CliCommandMap, CommandLineInterface, | ||||
| @ -116,7 +117,7 @@ fn inspect_chunk( | ||||
|  | ||||
|     let digest_raw: Option<[u8; 32]> = digest | ||||
|         .map(|ref d| { | ||||
|             proxmox::tools::hex_to_digest(d) | ||||
|             <[u8; 32]>::from_hex(d) | ||||
|                 .map_err(|e| format_err!("could not parse chunk - {}", e)) | ||||
|         }) | ||||
|         .map_or(Ok(None), |r| r.map(Some))?; | ||||
| @ -291,7 +292,7 @@ fn inspect_file( | ||||
|  | ||||
|             for pos in 0..index.index_count() { | ||||
|                 let digest = index.index_digest(pos).unwrap(); | ||||
|                 chunk_digests.insert(proxmox::tools::digest_to_hex(digest)); | ||||
|                 chunk_digests.insert(hex::encode(digest)); | ||||
|             } | ||||
|  | ||||
|             json!({ | ||||
|  | ||||
| @ -5,7 +5,6 @@ use std::path::Path; | ||||
| use anyhow::{bail, format_err, Error}; | ||||
| use serde_json::Value; | ||||
|  | ||||
| use proxmox::tools::digest_to_hex; | ||||
| use proxmox_router::cli::{CliCommand, CliCommandMap, CommandLineInterface}; | ||||
| use proxmox_schema::api; | ||||
|  | ||||
| @ -87,7 +86,7 @@ fn recover_index( | ||||
|     let mut data = Vec::with_capacity(4 * 1024 * 1024); | ||||
|     for pos in 0..index.index_count() { | ||||
|         let chunk_digest = index.index_digest(pos).unwrap(); | ||||
|         let digest_str = digest_to_hex(chunk_digest); | ||||
|         let digest_str = hex::encode(chunk_digest); | ||||
|         let digest_prefix = &digest_str[0..4]; | ||||
|         let chunk_path = chunks_path.join(digest_prefix).join(digest_str); | ||||
|         let mut chunk_file = std::fs::File::open(&chunk_path) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user