fix build

More places where String.format was missing a Locale

Original commit: elastic/x-pack-elasticsearch@6e3df91526
This commit is contained in:
uboness 2016-02-03 00:16:24 +01:00
parent db003cd2a4
commit 266917e1bc
2 changed files with 6 additions and 4 deletions

View File

@ -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");

View File

@ -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();
}