From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox Datacenter Manager development discussion
<pdm-devel@lists.proxmox.com>
Subject: [pdm-devel] NACK: [PATCH datacenter-manager] daily update: wire up subscription handling
Date: Wed, 03 Dec 2025 10:35:04 +0100 [thread overview]
Message-ID: <1764754477.cj0vobscwl.astroid@yuna.none> (raw)
In-Reply-To: <20251203092816.2866464-1-f.gruenbichler@proxmox.com>
On December 3, 2025 10:28 am, Fabian Grünbichler wrote:
> Signed-off-by: Fabian Grünbichler <f.gruenbichler@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@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
>
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
prev parent reply other threads:[~2025-12-03 9:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-03 9:28 [pdm-devel] " Fabian Grünbichler
2025-12-03 9:35 ` Fabian Grünbichler [this message]
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=1764754477.cj0vobscwl.astroid@yuna.none \
--to=f.gruenbichler@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