|
1 | 1 | /* |
2 | 2 | * VM-Operator |
3 | | - * Copyright (C) 2023,2024 Michael N. Lipp |
| 3 | + * Copyright (C) 2023,2025 Michael N. Lipp |
4 | 4 | * |
5 | 5 | * This program is free software: you can redistribute it and/or modify |
6 | 6 | * it under the terms of the GNU Affero General Public License as |
|
57 | 57 | import org.apache.commons.cli.Options; |
58 | 58 | import static org.jdrupes.vmoperator.common.Constants.APP_NAME; |
59 | 59 | import org.jdrupes.vmoperator.common.Constants.DisplaySecret; |
| 60 | +import org.jdrupes.vmoperator.runner.qemu.Constants.ProcessName; |
60 | 61 | import org.jdrupes.vmoperator.runner.qemu.commands.QmpCont; |
61 | 62 | import org.jdrupes.vmoperator.runner.qemu.commands.QmpReset; |
62 | 63 | import org.jdrupes.vmoperator.runner.qemu.events.ConfigureQemu; |
|
195 | 196 | "PMD.CouplingBetweenObjects", "PMD.TooManyFields" }) |
196 | 197 | public class Runner extends Component { |
197 | 198 |
|
198 | | - public static final String QEMU = "qemu"; |
199 | | - public static final String SWTPM = "swtpm"; |
200 | | - public static final String CLOUD_INIT_IMG = "cloudInitImg"; |
201 | 199 | private static final String TEMPLATE_DIR |
202 | 200 | = "/opt/" + APP_NAME.replace("-", "") + "/templates"; |
203 | 201 | private static final String DEFAULT_TEMPLATE |
@@ -350,15 +348,19 @@ private void processInitialConfiguration(Configuration newConfig) { |
350 | 348 | initialConfig = newConfig; |
351 | 349 |
|
352 | 350 | // Configure |
353 | | - swtpmDefinition = Optional.ofNullable(tplData.get(SWTPM)) |
354 | | - .map(d -> new CommandDefinition(SWTPM, d)).orElse(null); |
| 351 | + swtpmDefinition |
| 352 | + = Optional.ofNullable(tplData.get(ProcessName.SWTPM)) |
| 353 | + .map(d -> new CommandDefinition(ProcessName.SWTPM, d)) |
| 354 | + .orElse(null); |
355 | 355 | logger.finest(() -> swtpmDefinition.toString()); |
356 | | - qemuDefinition = Optional.ofNullable(tplData.get(QEMU)) |
357 | | - .map(d -> new CommandDefinition(QEMU, d)).orElse(null); |
| 356 | + qemuDefinition = Optional.ofNullable(tplData.get(ProcessName.QEMU)) |
| 357 | + .map(d -> new CommandDefinition(ProcessName.QEMU, d)) |
| 358 | + .orElse(null); |
358 | 359 | logger.finest(() -> qemuDefinition.toString()); |
359 | 360 | cloudInitImgDefinition |
360 | | - = Optional.ofNullable(tplData.get(CLOUD_INIT_IMG)) |
361 | | - .map(d -> new CommandDefinition(CLOUD_INIT_IMG, d)) |
| 361 | + = Optional.ofNullable(tplData.get(ProcessName.CLOUD_INIT_IMG)) |
| 362 | + .map(d -> new CommandDefinition(ProcessName.CLOUD_INIT_IMG, |
| 363 | + d)) |
362 | 364 | .orElse(null); |
363 | 365 | logger.finest(() -> cloudInitImgDefinition.toString()); |
364 | 366 |
|
|
0 commit comments