sync: pull snapshot: use template variables for bloat reduction
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
5566099849
commit
87cdc327b9
@ -391,13 +391,12 @@ async fn pull_snapshot(
|
|||||||
StatusCode::NOT_FOUND => {
|
StatusCode::NOT_FOUND => {
|
||||||
task_log!(
|
task_log!(
|
||||||
worker,
|
worker,
|
||||||
"skipping snapshot {} - vanished since start of sync",
|
"skipping snapshot {snapshot} - vanished since start of sync",
|
||||||
snapshot
|
|
||||||
);
|
);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
bail!("HTTP error {} - {}", code, message);
|
bail!("HTTP error {code} - {message}");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
@ -411,22 +410,14 @@ async fn pull_snapshot(
|
|||||||
if manifest_name.exists() {
|
if manifest_name.exists() {
|
||||||
let manifest_blob = proxmox_lang::try_block!({
|
let manifest_blob = proxmox_lang::try_block!({
|
||||||
let mut manifest_file = std::fs::File::open(&manifest_name).map_err(|err| {
|
let mut manifest_file = std::fs::File::open(&manifest_name).map_err(|err| {
|
||||||
format_err!(
|
format_err!("unable to open local manifest {manifest_name:?} - {err}")
|
||||||
"unable to open local manifest {:?} - {}",
|
|
||||||
manifest_name,
|
|
||||||
err
|
|
||||||
)
|
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let manifest_blob = DataBlob::load_from_reader(&mut manifest_file)?;
|
let manifest_blob = DataBlob::load_from_reader(&mut manifest_file)?;
|
||||||
Ok(manifest_blob)
|
Ok(manifest_blob)
|
||||||
})
|
})
|
||||||
.map_err(|err: Error| {
|
.map_err(|err: Error| {
|
||||||
format_err!(
|
format_err!("unable to read local manifest {manifest_name:?} - {err}")
|
||||||
"unable to read local manifest {:?} - {}",
|
|
||||||
manifest_name,
|
|
||||||
err
|
|
||||||
)
|
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
if manifest_blob.raw_data() == tmp_manifest_blob.raw_data() {
|
if manifest_blob.raw_data() == tmp_manifest_blob.raw_data() {
|
||||||
|
Loading…
Reference in New Issue
Block a user