From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 290101FF139 for ; Tue, 27 Jan 2026 12:27:00 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9B03020821; Tue, 27 Jan 2026 12:27:23 +0100 (CET) Mime-Version: 1.0 Date: Tue, 27 Jan 2026 12:27:20 +0100 Message-Id: To: "Lukas Wagner" , "Proxmox Datacenter Manager development discussion" From: "Shan Shaji" X-Mailer: aerc 0.20.0 References: <20260123172910.244121-1-s.shaji@proxmox.com> <20260123172910.244121-2-s.shaji@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1769513176044 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.107 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] [PATCH datacenter-manager 1/3] cli: admin: make cli handling async X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" On Tue Jan 27, 2026 at 10:17 AM CET, Lukas Wagner wrote: > Hi Shan, thanks for these patches! > > Some comments inline. > > On Fri Jan 23, 2026 at 6:29 PM CET, Shan Shaji wrote: >> worker tasks. >> >> Since `init_worker_tasks` needs to be called from an async runtime. >> Moved the content of the main function to async `run` function and >> wrapped using `proxmox_async::runtime::main`, which creates a Tokio >> runtime. >> >> Signed-off-by: Shan Shaji >> --- >> cli/admin/Cargo.toml | 3 +++ [...] >> mod remotes; >> mod support_status; >> >> -fn main() { >> - //pbs_tools::setup_libc_malloc_opts(); // TODO: move from PBS to proxmox-sys and uncomment >> - >> - let api_user = pdm_config::api_user().expect("cannot get api user"); >> - let priv_user = pdm_config::priv_user().expect("cannot get privileged user"); >> - proxmox_product_config::init(api_user, priv_user); >> +async fn run() -> Result<(), Error> { >> + let api_user = pdm_config::api_user()?; >> + let priv_user = pdm_config::priv_user()?; > > if you convert these .expect("...") calls to errors and bubble them up, > if would be nice if you used .context() from anyhow to preserve the > error messages. E.g.: > > > let priv_user = pdm_config::priv_user().context("could not get privileged user")?; Sure will udpate it. >> >> + proxmox_product_config::init(api_user.clone(), priv_user); >> proxmox_access_control::init::init( >> &pdm_api_types::AccessControlConfig, >> pdm_buildcfg::configdir!("/access"), >> - ) >> - .expect("failed to setup access control config"); >> - >> + )?; >> proxmox_log::Logger::from_env("PDM_LOG", proxmox_log::LevelFilter::INFO) >> .stderr() >> - .init() >> - .expect("failed to set up logger"); >> + .init()?; >> >> - server::context::init().expect("could not set up server context"); >> + server::context::init()?; >> >> let cmd_def = CliCommandMap::new() >> .insert("remote", remotes::cli()) >> @@ -40,14 +36,29 @@ fn main() { >> .insert("support-status", support_status::cli()) >> .insert("versions", CliCommand::new(&API_METHOD_GET_VERSIONS)); >> [...] _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel