Fix search path and log when testing.

This commit is contained in:
Michael Lipp 2023-06-11 17:47:59 +02:00
parent 6a1eef84c9
commit e1e4e9d0d0
3 changed files with 16 additions and 1 deletions

View file

@ -117,3 +117,16 @@ data:
"spice": "spice":
"port": {{ .Values.vm.spicePort }} "port": {{ .Values.vm.spicePort }}
# "usbRedirects": 2 # "usbRedirects": 2
logging.properties: |
handlers=java.util.logging.ConsoleHandler
#org.jgrapes.level=FINE
#org.jgrapes.core.handlerTracking.level=FINER
org.jdrupes.vmoperator.runner.qemu.level=FINE
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=%1$tb %1$td %1$tT %4$s %5$s%6$s%n

View file

@ -200,7 +200,7 @@ public class Runner extends Component {
attach(new SocketConnector(channel())); attach(new SocketConnector(channel()));
attach(qemuMonitor = new QemuMonitor(channel())); attach(qemuMonitor = new QemuMonitor(channel()));
// Configuration store with file in /etc (default) // Configuration store with file in /etc/opt (default)
File config = new File(cmdLine.getOptionValue('c', File config = new File(cmdLine.getOptionValue('c',
"/etc/opt/" + APP_NAME + "/config.yaml")); "/etc/opt/" + APP_NAME + "/config.yaml"));
// Don't rely on night config to produce a good exception // Don't rely on night config to produce a good exception

View file

@ -146,6 +146,7 @@ public class FsdUtils {
* *
* 1. the current working directory, * 1. the current working directory,
* 1. the {@link #configHome(String)} * 1. the {@link #configHome(String)}
* 1. the subdirectory `appName` of `/etc/opt`
* 1. the subdirectory `appName` of `/etc` * 1. the subdirectory `appName` of `/etc`
* *
* @param appName the application name * @param appName the application name
@ -156,6 +157,7 @@ public class FsdUtils {
String filename) { String filename) {
var candidates = List.of(Path.of(filename), var candidates = List.of(Path.of(filename),
configHome(appName).resolve(filename), configHome(appName).resolve(filename),
Path.of("/etc").resolve("opt").resolve(appName).resolve(filename),
Path.of("/etc").resolve(appName).resolve(filename)); Path.of("/etc").resolve(appName).resolve(filename));
for (var candidate : candidates) { for (var candidate : candidates) {
if (Files.exists(candidate)) { if (Files.exists(candidate)) {