From fa07b02f6e09f776b3afe5709e8fee1764c11a2a Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 5 Jun 2024 10:44:17 +0200 Subject: [PATCH] nuageinit: make addsshkey friendly for testsuite --- libexec/nuageinit/nuage.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 020b54b0776c..ca70c778791b 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -177,6 +177,10 @@ end local function addsshkey(homedir, key) local chownak = false local chowndotssh = false + local root = os.getenv("NUAGE_FAKE_ROOTDIR") + if root then + homedir = root .. "/" .. homedir + end local ak_path = homedir .. "/.ssh/authorized_keys" local dotssh_path = homedir .. "/.ssh" local dirattrs = lfs.attributes(ak_path)