From 579980ca75dfbc27639259c773dfc5fe1ec9e32a Mon Sep 17 00:00:00 2001 From: "Carpenter, Adam (CORP)" Date: Mon, 17 Jan 2022 14:57:18 -0500 Subject: feat: log data for station being removed in simple_deprov --- angelsharkd/src/routes/extensions/simple_deprov/mod.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'angelsharkd/src') diff --git a/angelsharkd/src/routes/extensions/simple_deprov/mod.rs b/angelsharkd/src/routes/extensions/simple_deprov/mod.rs index fc734f3..77bde55 100644 --- a/angelsharkd/src/routes/extensions/simple_deprov/mod.rs +++ b/angelsharkd/src/routes/extensions/simple_deprov/mod.rs @@ -1,5 +1,5 @@ use libangelshark::{AcmRunner, Message, ParallelIterator}; -use log::error; +use log::{error, info}; use serde::Deserialize; use std::convert::Infallible; use warp::{ @@ -24,10 +24,12 @@ async fn remove_entries(entries: Entries, mut runner: AcmRunner) -> Result { + runner.queue_input(&acm, &Message::new(&format!("list station {}", ext))); runner.queue_input(&acm, &Message::new(&format!("clear amw all {}", ext))); runner.queue_input(&acm, &Message::new(&format!("remove station {}", ext))); } Entry::AgentLoginId { acm, ext } => { + runner.queue_input(&acm, &Message::new(&format!("list agent-loginID {}", ext))); runner.queue_input( &acm, &Message::new(&format!("remove agent-loginID {}", ext)), @@ -42,7 +44,16 @@ async fn remove_entries(entries: Entries, mut runner: AcmRunner) -> Result messages .into_iter() - .filter_map(|message| Some(format!("ACM {}: {}", acm.clone(), message.error?))) + .filter_map(|message| { + if let Some(data) = message + .datas + .and_then(|d| Some(format!("{acm}\t{}", d.get(0)?.join("\t")))) + { + // if there was data (such as in lists), print it out + info!("{data}"); + } + Some(format!("ACM {}: {}", acm.clone(), message.error?)) + }) .collect(), Err(error) => vec![format!("ACM {}: {}", acm, error)], }) -- cgit v1.2.3