Skip to content

Commit

Permalink
outscale_api_version: show old version when available
Browse files Browse the repository at this point in the history
Signed-off-by: jerome.jutteau <[email protected]>
  • Loading branch information
jerome-jutteau committed Apr 22, 2024
1 parent 56a0d37 commit 208aa00
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/outscale_api_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,19 @@ impl OutscaleApiVersions {
let mut messages = Vec::<Message>::new();
for endpoint in self.endpoints.iter_mut() {
trace!("updating {} version", endpoint.name);
if let Some(v) = endpoint.update_version().await {
messages.push(format!("New API version on {}: {}", endpoint.name, v));
let old_version = endpoint.version.clone();
if let Some(current_version) = endpoint.update_version().await {
if let Some(old_version) = old_version {
messages.push(format!(
"New API version on {}: {} -> {}",
endpoint.name, old_version, current_version
));
} else {
messages.push(format!(
"New API version on {}: {}",
endpoint.name, current_version
));
}
}
}
if messages.is_empty() {
Expand Down

0 comments on commit 208aa00

Please sign in to comment.