pbs-client: don't include empty backup-ns in requests
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
68857aecb3
commit
c18d481fd7
@ -50,14 +50,19 @@ impl BackupReader {
|
||||
backup: &BackupDir,
|
||||
debug: bool,
|
||||
) -> Result<Arc<BackupReader>, Error> {
|
||||
let param = json!({
|
||||
"backup-ns": backup.ns(),
|
||||
let mut param = json!({
|
||||
"backup-type": backup.ty(),
|
||||
"backup-id": backup.id(),
|
||||
"backup-time": backup.time,
|
||||
"store": datastore,
|
||||
"debug": debug,
|
||||
});
|
||||
|
||||
let ns = backup.ns();
|
||||
if !ns.is_root() {
|
||||
param["backup-ns"] = serde_json::to_value(ns)?;
|
||||
}
|
||||
|
||||
let req = HttpClient::request_builder(
|
||||
client.server(),
|
||||
client.port(),
|
||||
|
@ -90,8 +90,7 @@ impl BackupWriter {
|
||||
debug: bool,
|
||||
benchmark: bool,
|
||||
) -> Result<Arc<BackupWriter>, Error> {
|
||||
let param = json!({
|
||||
"backup-ns": backup.ns(),
|
||||
let mut param = json!({
|
||||
"backup-type": backup.ty(),
|
||||
"backup-id": backup.id(),
|
||||
"backup-time": backup.time,
|
||||
@ -100,6 +99,11 @@ impl BackupWriter {
|
||||
"benchmark": benchmark
|
||||
});
|
||||
|
||||
let ns = backup.ns();
|
||||
if !ns.is_root() {
|
||||
param["backup-ns"] = serde_json::to_value(ns)?;
|
||||
}
|
||||
|
||||
let req = HttpClient::request_builder(
|
||||
client.server(),
|
||||
client.port(),
|
||||
|
Loading…
Reference in New Issue
Block a user