Skip to content

Commit

Permalink
#1906 typo
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 1, 2024
1 parent efa96a1 commit a836d9e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/com/rultor/agents/aws/PingsInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public PingsInstance() {
@Override
@SuppressWarnings("PMD.AvoidCatchingGenericException")
public Iterable<Directive> process(final XML xml) throws IOException {
final String name = xml.xpath("/talk/@name").get(0);
final Shell shell = new TalkShells(xml).get();
final String instance = xml.xpath("/talk/ec2/instance/text()").get(0);
final String host = xml.xpath("/talk/shell/host/text()").get(0);
Expand All @@ -73,19 +74,23 @@ public Iterable<Directive> process(final XML xml) throws IOException {
new Shell.Empty(new Shell.Safe(shell)).exec("whoami");
Logger.warn(
this, "AWS instance %s is alive at %s for %s",
instance, host, xml.xpath("/talk/@name").get(0)
instance, host, name
);
break;
// @checkstyle IllegalCatchCheck (1 line)
} catch (final Exception ex) {
Logger.warn(
this, "Failed to ping AWS instance %s at %s (attempt no.%d): %s",
instance, host, attempt, ex.getMessage()
this,
"Failed to ping AWS instance %s at %s for %s (attempt no.%d): %s",
instance, host, name, attempt, ex.getMessage()
);
++attempt;
if (attempt > 5) {
dirs.xpath("/talk/daemon").remove();
Logger.warn(this, "The AWS instance %s is officially dead", instance);
Logger.warn(
this, "The AWS instance %s is officially dead at %s",
instance, name
);
break;
}
new Sleep(1L).now();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/rultor/agents/aws/ShootsInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public Iterable<Directive> process(final XML xml) throws IOException {
.withInstanceIds(instance)
);
Logger.warn(
this,
"Terminated AWS instance %s because it's %[ms]s old (most probably dead)",
instance, age
);
Expand Down

0 comments on commit a836d9e

Please sign in to comment.