From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer] tui: honor test mode flag when starting low-level install session
Date: Wed, 20 Sep 2023 13:39:35 +0200 [thread overview]
Message-ID: <20230920114012.712670-1-c.heiss@proxmox.com> (raw)
Even if the installer is run in release mode, the test-mode flag should
be honored on whether to start a test-installation or not.
The test mode is always forced on in debug builds, so the cfg()
conditionals can be dropped.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
proxmox-tui-installer/src/main.rs | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/proxmox-tui-installer/src/main.rs b/proxmox-tui-installer/src/main.rs
index 23a4ead..3f01713 100644
--- a/proxmox-tui-installer/src/main.rs
+++ b/proxmox-tui-installer/src/main.rs
@@ -727,6 +727,7 @@ fn install_progress_dialog(siv: &mut Cursive) -> InstallerView {
let cb_sink = siv.cb_sink().clone();
let state = siv.user_data::<InstallerState>().unwrap();
+ let in_test_mode = state.in_test_mode;
let progress_text = TextContent::new("starting the installation ..");
let progress_task = {
@@ -736,16 +737,15 @@ fn install_progress_dialog(siv: &mut Cursive) -> InstallerView {
let child = {
use std::process::{Command, Stdio};
- #[cfg(not(debug_assertions))]
- let (path, args, envs): (&str, [&str; 1], [(&str, &str); 0]) =
- ("proxmox-low-level-installer", ["start-session"], []);
-
- #[cfg(debug_assertions)]
- let (path, args, envs) = (
- PathBuf::from("./proxmox-low-level-installer"),
- ["-t", "start-session-test"],
- [("PERL5LIB", ".")],
- );
+ let (path, args, envs): (&str, &[&str], Vec<(&str, &str)>) = if in_test_mode {
+ (
+ "./proxmox-low-level-installer",
+ &["-t", "start-session-test"],
+ vec![("PERL5LIB", ".")],
+ )
+ } else {
+ ("proxmox-low-level-installer", &["start-session"], vec![])
+ };
Command::new(path)
.args(args)
--
2.41.0
next reply other threads:[~2023-09-20 11:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-20 11:39 Christoph Heiss [this message]
2023-09-20 14:33 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230920114012.712670-1-c.heiss@proxmox.com \
--to=c.heiss@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox