diff --git a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/crypto/tool/SystemKeyTool.java b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/crypto/tool/SystemKeyTool.java index decf56baf24..39ae9cdc9e2 100644 --- a/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/crypto/tool/SystemKeyTool.java +++ b/elasticsearch/x-pack/shield/src/main/java/org/elasticsearch/shield/crypto/tool/SystemKeyTool.java @@ -22,6 +22,7 @@ import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.nio.file.attribute.PosixFileAttributeView; import java.nio.file.attribute.PosixFilePermission; +import java.util.Locale; import java.util.Set; import static org.elasticsearch.common.cli.CliToolConfig.Builder.cmd; @@ -97,10 +98,10 @@ public class SystemKeyTool extends CliTool { } terminal.println(Terminal.Verbosity.VERBOSE, "generating..."); byte[] key = InternalCryptoService.generateKey(); - terminal.println(String.format("Storing generated key in [%s]...", path.toAbsolutePath())); + terminal.println(String.format(Locale.ROOT, "Storing generated key in [%s]...", path.toAbsolutePath())); Files.write(path, key, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } catch (IOException ioe) { - terminal.printError(String.format("Cannot generate and save system key file [%s]", path.toAbsolutePath())); + terminal.printError(String.format(Locale.ROOT, "Cannot generate and save system key file [%s]", path.toAbsolutePath())); return ExitStatus.IO_ERROR; } @@ -109,7 +110,7 @@ public class SystemKeyTool extends CliTool { try { Files.setPosixFilePermissions(path, PERMISSION_OWNER_READ_WRITE); } catch (IOException ioe) { - terminal.printError(String.format("Cannot set owner read/write permissions to generated system key file [%s]", path.toAbsolutePath())); + terminal.printError(String.format(Locale.ROOT, "Cannot set owner read/write permissions to generated system key file [%s]", path.toAbsolutePath())); return ExitStatus.IO_ERROR; } terminal.println("Ensure the generated key can be read by the user that Elasticsearch runs as, permissions are set to owner read/write only"); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTester.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTester.java index 6a277cf1032..786ae049342 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTester.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/service/ManualPublicSmtpServersTester.java @@ -18,6 +18,7 @@ import org.elasticsearch.watcher.support.secret.SecretService; import java.io.IOException; import java.io.InputStream; import java.util.Collections; +import java.util.Locale; @AwaitsFix(bugUrl = "https://github.com/elastic/x-plugins/issues/379") public class ManualPublicSmtpServersTester { @@ -121,7 +122,7 @@ public class ManualPublicSmtpServersTester { EmailService.EmailSent sent = service.send(email, null, profile); - terminal.println(String.format("email sent via account [%s]", sent.account())); + terminal.println(String.format(Locale.ROOT, "email sent via account [%s]", sent.account())); } finally { service.stop(); }