From 76227a6acd5b272a77fb033c2cf822282d0ce0d8 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 25 Apr 2020 17:20:22 +0200 Subject: [PATCH] src/bin/proxmox-backup-manager.rs: fix node parameter handling --- src/bin/proxmox-backup-manager.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs index 9f535a21..a19eec8b 100644 --- a/src/bin/proxmox-backup-manager.rs +++ b/src/bin/proxmox-backup-manager.rs @@ -244,10 +244,12 @@ fn acl_commands() -> CommandLineInterface { } )] /// Network device list. -fn list_network_devices(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result { +fn list_network_devices(mut param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result { let output_format = get_output_format(¶m); + param["node"] = "localhost".into(); + let info = &api2::node::network::API_METHOD_LIST_NETWORK_DEVICES; let mut data = match info.handler { ApiHandler::Sync(handler) => (handler)(param, info, rpcenv)?, @@ -306,7 +308,8 @@ fn list_network_devices(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result #[api()] /// Show pending configuration changes (diff) -fn pending_network_changes(param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result { +fn pending_network_changes(mut param: Value, rpcenv: &mut dyn RpcEnvironment) -> Result { + param["node"] = "localhost".into(); let info = &api2::node::network::API_METHOD_LIST_NETWORK_DEVICES; let _data = match info.handler { @@ -329,12 +332,10 @@ fn network_commands() -> CommandLineInterface { .insert( "list", CliCommand::new(&API_METHOD_LIST_NETWORK_DEVICES) - .fixed_param("node", String::from("localhost")) ) .insert( "changes", CliCommand::new(&API_METHOD_PENDING_NETWORK_CHANGES) - .fixed_param("node", String::from("localhost")) ) .insert( "update",