Otherwise, if the underlying detect_architecture(...) method returns any
false value, the return value of the call to protected_call(...) will
return an empty string.

This sets the architecture to an empty string and will make the
container fail to start.

Signed-off-by: Daniel Kral <[email protected]>
---
 src/PVE/LXC/Setup.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
index 113093d..fb0207e 100644
--- a/src/PVE/LXC/Setup.pm
+++ b/src/PVE/LXC/Setup.pm
@@ -153,7 +153,7 @@ sub new {
             warn "Architecture detection failed: $err" if $err;
         }
 
-        if (!defined($arch)) {
+        if (!$arch) {
             $arch = 'amd64';
             print "Falling back to $arch.\nUse `pct set VMID --arch ARCH` to 
change.\n";
         } else {
-- 
2.47.3




Reply via email to