]> git.proxmox.com Git - proxmox-offline-mirror.git/commitdiff
keys: improve output on add/refresh
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 7 Sep 2022 12:12:27 +0000 (14:12 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 7 Sep 2022 12:12:27 +0000 (14:12 +0200)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/bin/proxmox_offline_mirror_cmds/subscription.rs

index c71ed395237bd818788f861117105317339534ec..ec4656c70d5e9764519569d1be3e37c820292353 100644 (file)
@@ -121,7 +121,12 @@ async fn add_mirror_key(config: Option<String>, key: String, _param: Value) -> R
         proxmox_offline_mirror::subscription::refresh(data.clone(), vec![], public_key()?).await?;
 
     if let Some(info) = refreshed.pop() {
-        eprintln!("info: {info:?}");
+        eprintln!(
+            "Refreshed subscription info - status: {}, message: {}",
+            info.status,
+            info.message.as_ref().unwrap_or(&"-".to_string())
+        );
+
         if info.key.as_ref() == Some(&data.key) {
             data.info = Some(base64::encode(serde_json::to_vec(&info)?));
         } else {
@@ -291,9 +296,14 @@ pub async fn refresh_keys(config: Option<String>, key: Option<String>) -> Result
     };
 
     for info in refreshed {
-        eprintln!("info: {info:?}");
         match info.clone().key {
             Some(key) => {
+                eprintln!(
+                    "Refreshed subscription info - key: {}, status: {}, message: {}",
+                    &key,
+                    info.status,
+                    info.message.as_ref().unwrap_or(&"-".to_string())
+                );
                 let key = key.clone();
                 let mut data: SubscriptionKey = config.lookup("subscription", &key)?;
                 data.info = Some(base64::encode(serde_json::to_vec(&info)?));