public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Shan Shaji" <s.shaji@proxmox.com>
To: "Lukas Wagner" <l.wagner@proxmox.com>,
	"Proxmox Datacenter Manager development discussion"
	<pdm-devel@lists.proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager 1/3] cli: admin: make cli handling async
Date: Tue, 27 Jan 2026 12:27:20 +0100	[thread overview]
Message-ID: <DFZC3CJBQXFC.S0EUWXK3JMBB@proxmox.com> (raw)
In-Reply-To: <DFZ9BS9TCBLM.3GTYR8FR24RZ6@proxmox.com>

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 <s.shaji@proxmox.com>
>> ---
>>  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


  reply	other threads:[~2026-01-27 11:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 17:29 [pdm-devel] [PATCH datacenter-manager 0/3] fix #7179: expose ACME commands inside admin CLI Shan Shaji
2026-01-23 17:29 ` [pdm-devel] [PATCH datacenter-manager 1/3] cli: admin: make cli handling async Shan Shaji
2026-01-27  9:17   ` Lukas Wagner
2026-01-27 11:27     ` Shan Shaji [this message]
2026-01-23 17:29 ` [pdm-devel] [PATCH datacenter-manager 2/3] fix #7179: cli: admin: expose acme commands Shan Shaji
2026-01-27  9:17   ` Lukas Wagner
2026-01-27 11:14     ` Shan Shaji
2026-01-27 12:09       ` Lukas Wagner
2026-01-27 17:33         ` Shan Shaji
2026-01-28  8:19           ` Lukas Wagner
2026-01-28  9:26     ` Gabriel Goller
2026-01-28  9:35       ` Shan Shaji
2026-02-03 17:55         ` Shan Shaji
2026-01-23 17:29 ` [pdm-devel] [PATCH datacenter-manager 3/3] chore: update proxmox-acme to version 1 Shan Shaji

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DFZC3CJBQXFC.S0EUWXK3JMBB@proxmox.com \
    --to=s.shaji@proxmox.com \
    --cc=l.wagner@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal