fix build
More places where String.format was missing a Locale Original commit: elastic/x-pack-elasticsearch@6e3df91526
This commit is contained in:
parent
db003cd2a4
commit
266917e1bc
|
@ -22,6 +22,7 @@ import java.nio.file.Path;
|
||||||
import java.nio.file.StandardOpenOption;
|
import java.nio.file.StandardOpenOption;
|
||||||
import java.nio.file.attribute.PosixFileAttributeView;
|
import java.nio.file.attribute.PosixFileAttributeView;
|
||||||
import java.nio.file.attribute.PosixFilePermission;
|
import java.nio.file.attribute.PosixFilePermission;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import static org.elasticsearch.common.cli.CliToolConfig.Builder.cmd;
|
import static org.elasticsearch.common.cli.CliToolConfig.Builder.cmd;
|
||||||
|
@ -97,10 +98,10 @@ public class SystemKeyTool extends CliTool {
|
||||||
}
|
}
|
||||||
terminal.println(Terminal.Verbosity.VERBOSE, "generating...");
|
terminal.println(Terminal.Verbosity.VERBOSE, "generating...");
|
||||||
byte[] key = InternalCryptoService.generateKey();
|
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);
|
Files.write(path, key, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
|
||||||
} catch (IOException ioe) {
|
} 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;
|
return ExitStatus.IO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +110,7 @@ public class SystemKeyTool extends CliTool {
|
||||||
try {
|
try {
|
||||||
Files.setPosixFilePermissions(path, PERMISSION_OWNER_READ_WRITE);
|
Files.setPosixFilePermissions(path, PERMISSION_OWNER_READ_WRITE);
|
||||||
} catch (IOException ioe) {
|
} 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;
|
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");
|
terminal.println("Ensure the generated key can be read by the user that Elasticsearch runs as, permissions are set to owner read/write only");
|
||||||
|
|
|
@ -18,6 +18,7 @@ import org.elasticsearch.watcher.support.secret.SecretService;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
@AwaitsFix(bugUrl = "https://github.com/elastic/x-plugins/issues/379")
|
@AwaitsFix(bugUrl = "https://github.com/elastic/x-plugins/issues/379")
|
||||||
public class ManualPublicSmtpServersTester {
|
public class ManualPublicSmtpServersTester {
|
||||||
|
@ -121,7 +122,7 @@ public class ManualPublicSmtpServersTester {
|
||||||
|
|
||||||
EmailService.EmailSent sent = service.send(email, null, profile);
|
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 {
|
} finally {
|
||||||
service.stop();
|
service.stop();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue