move fingerprint helpers from pbs-tools to pbs-api-types

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer
2021-11-17 07:07:40 +01:00
parent 96ec3801a9
commit c42a54795d
8 changed files with 47 additions and 49 deletions

View File

@ -21,6 +21,7 @@ use pbs_api_types::{
};
use pbs_api_types::{PRIV_TAPE_AUDIT, PRIV_TAPE_READ, PRIV_TAPE_WRITE};
use pbs_config::CachedUserInfo;
use pbs_tape::{
BlockReadError,
@ -695,7 +696,7 @@ pub async fn read_label(
flat.encryption_key_fingerprint = set
.encryption_key_fingerprint
.as_ref()
.map(|fp| pbs_tools::format::as_fingerprint(fp.bytes()));
.map(|fp| fp.to_string());
let encrypt_fingerprint = set.encryption_key_fingerprint.clone()
.map(|fp| (fp, set.uuid.clone()));

View File

@ -317,7 +317,7 @@ impl TapeDriver for LtoTapeHandle {
}
let output = if let Some((fingerprint, uuid)) = key_fingerprint {
let fingerprint = pbs_tools::format::as_fingerprint(fingerprint.bytes());
let fingerprint = fingerprint.to_string();
run_sg_tape_cmd("encryption", &[
"--fingerprint", &fingerprint,
"--uuid", &uuid.to_string(),