fix 'remove_vanished' cli arg again

since the target side wants this to be a boolean and
serde interprets a None Value as 'null' we have to only
add this when it is really set via cli

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-05-27 16:42:23 +02:00 committed by Dietmar Maurer
parent 05d755b282
commit 8c87743642

View File

@ -284,13 +284,16 @@ async fn pull_datastore(
let mut client = connect()?;
let args = json!({
let mut args = json!({
"store": local_store,
"remote": remote,
"remote-store": remote_store,
"remove-vanished": remove_vanished,
});
if let Some(remove_vanished) = remove_vanished {
args["remove-vanished"] = Value::from(remove_vanished);
}
let result = client.post("api2/json/pull", Some(args)).await?;
view_task_result(client, result, &output_format).await?;