[pdm-devel] NACK: [PATCH datacenter-manager] daily update: wire up subscription handling

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Dec 3 10:35:04 CET 2025


On December 3, 2025 10:28 am, Fabian Grünbichler wrote:
> Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> ---
>  ...proxmox-datacenter-manager-daily-update.rs | 27 +++++++++----------
>  1 file changed, 12 insertions(+), 15 deletions(-)
> 
> diff --git a/server/src/bin/proxmox-datacenter-manager-daily-update.rs b/server/src/bin/proxmox-datacenter-manager-daily-update.rs
> index 43ad538..f0bfcd5 100644
> --- a/server/src/bin/proxmox-datacenter-manager-daily-update.rs
> +++ b/server/src/bin/proxmox-datacenter-manager-daily-update.rs
> @@ -3,7 +3,7 @@ use serde_json::json;
>  
>  //use proxmox_notify::context::pbs::PBS_CONTEXT;
>  use proxmox_router::{cli::*, ApiHandler, RpcEnvironment};
> -//use proxmox_subscription::SubscriptionStatus;
> +use proxmox_subscription::SubscriptionStatus;
>  use proxmox_sys::fs::CreateOptions;
>  
>  use server::api;
> @@ -23,25 +23,21 @@ async fn wait_for_local_worker(upid_str: &str) -> Result<(), Error> {
>  
>  /// Daily update
>  async fn do_update(rpcenv: &mut dyn RpcEnvironment) -> Result<(), Error> {
> -    /*
> -    let param = json!({});
> -    let method = &api::node::subscription::API_METHOD_CHECK_SUBSCRIPTION;
> -    match method.handler {
> -        ApiHandler::Sync(handler) => {
> -            if let Err(err) = (handler)(param.clone(), method, rpcenv) {
> -                log::error!("Error checking subscription - {err}");
> -            }
> -        }
> -        _ => unreachable!(),
> +    if let Err(err) = &api::nodes::subscription::check_subscription().await {
> +        log::error!("Error checking subscription - {err}");
>      }
> -    let notify = match api::node::subscription::get_subscription(param, rpcenv) {
> -        Ok(info) => info.status == SubscriptionStatus::Active,
> +    match api::nodes::subscription::get_subscription().await {
> +        Ok(info) if info.info.status == SubscriptionStatus::Active => {}
> +        Ok(info) => {
> +            log::warn!(
> +                "Subscription not active: {status}",
> +                status = info.info.status
> +            )
> +        }
>          Err(err) => {
>              log::error!("Error reading subscription - {err}");
> -            false
>          }
>      };
> -    */
>  
>      println!("updating apt package database");
>      let param = json!({
> @@ -102,6 +98,7 @@ async fn run(rpcenv: &mut dyn RpcEnvironment) -> Result<(), Error> {
>  
>      //proxmox_notify::context::set_context(&PBS_CONTEXT);
>  
> +    pdm_config::remotes::init(Box::new(pdm_config::remotes::DefaultRemoteConfig));

this needs to be a context init call, else it fails if there are remotes configured..

>      do_update(rpcenv).await
>  }
>  
> -- 
> 2.47.3
> 
> 
> 
> _______________________________________________
> pdm-devel mailing list
> pdm-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
> 




More information about the pdm-devel mailing list