Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

EX-1874 stratagem: iml-agent needs to be more verbose #2310

Merged
merged 2 commits into from
Oct 7, 2020

Conversation

beevans
Copy link
Contributor

@beevans beevans commented Oct 6, 2020

Report success and failures from iml-agent filesync and
cloudsync jobs

Signed-off-by: Ben Evans beevans@whamcloud.com


This change is Reviewable

Report success and failures from iml-agent filesync and
cloudsync jobs

Signed-off-by: Ben Evans <beevans@whamcloud.com>
@beevans beevans self-assigned this Oct 6, 2020
@@ -560,7 +560,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let fids: Vec<_> = fids.into_iter().map(Result::unwrap).collect();
let errors: Vec<_> = errors.into_iter().map(Result::unwrap_err).collect();
if !errors.is_empty() {
tracing::error!("files not found, ignoring: {:?}", errors);
println!("files not found, ignoring: {:?}", errors);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
println!("files not found, ignoring: {:?}", errors);
eprintln!("files not found, ignoring: {:?}", errors);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

exit(0);
}

for err in reslist.iter() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How large might this list be?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As many items as the user typed in (not more)

match result {
Ok(reslist) => {
if reslist.is_empty() {
println!("Ok!");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
println!("Ok!");
println!("FIDs processed successfully");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

for err in reslist.iter() {
println!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
println!(
eprintln!(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}
}
Err(e) => {
println!("cloudsync failed {}", e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
println!("cloudsync failed {}", e);
eprintln!("cloudsync failed {}", e);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Signed-off-by: Ben Evans <beevans@whamcloud.com>
@jgrund jgrund self-requested a review October 7, 2020 13:36
@jgrund jgrund merged commit 715be65 into master Oct 7, 2020
@jgrund jgrund deleted the EX-1874-error-messages branch October 7, 2020 13:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants