Blame SOURCES/0009-customize-add-reminder-about-key-ID-clevis.patch

7b180b
From fe59e93b27e3bc17b5cc0874e103330e0000b210 Mon Sep 17 00:00:00 2001
7b180b
From: Laszlo Ersek <lersek@redhat.com>
7b180b
Date: Tue, 28 Jun 2022 13:57:01 +0200
7b180b
Subject: [PATCH] customize: add reminder about "--key ID:clevis"
7b180b
7b180b
virt-customize already enables appliance networking by default;
7b180b
conversely, if the user passes "--no-network", we shouldn't override that
7b180b
for the sake of "--key ID:clevis". Add comments about clevis to the code.
7b180b
7b180b
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1809453
7b180b
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
7b180b
Message-Id: <20220628115702.5584-4-lersek@redhat.com>
7b180b
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
7b180b
(cherry picked from commit e52aea48cbcea3f3b538db0573b58517cbc33da0)
7b180b
---
7b180b
 customize/customize_main.ml | 7 +++++++
7b180b
 1 file changed, 7 insertions(+)
7b180b
7b180b
diff --git a/customize/customize_main.ml b/customize/customize_main.ml
7b180b
index 8a022342f..32b7eebdd 100644
7b180b
--- a/customize/customize_main.ml
7b180b
+++ b/customize/customize_main.ml
7b180b
@@ -52,7 +52,11 @@ let main () =
7b180b
   let libvirturi = ref "" in
7b180b
   let memsize = ref None in
7b180b
   let set_memsize arg = memsize := Some arg in
7b180b
+
7b180b
+  (* Note that [--key ID:clevis] depends on this default. See more below, near
7b180b
+   * [g#set_network network]. *)
7b180b
   let network = ref true in
7b180b
+
7b180b
   let smp = ref None in
7b180b
   let set_smp arg = smp := Some arg in
7b180b
 
7b180b
@@ -159,6 +163,9 @@ read the man page virt-customize(1).
7b180b
     let g = open_guestfs () in
7b180b
     Option.may g#set_memsize memsize;
7b180b
     Option.may g#set_smp smp;
7b180b
+    (* [--no-network] from the command line takes precedence over the automatic
7b180b
+     * network enablement for [--key ID:clevis], so here we intentionally don't check
7b180b
+     * [key_store_requires_network opthandle.ks]. *)
7b180b
     g#set_network network;
7b180b
 
7b180b
     (* Add disks. *)
7b180b
-- 
7b180b
2.31.1
7b180b