Skip to content
Snippets Groups Projects
Commit 9a6ade06 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a default PATH variable to OS scripts env


In commit 896a03f6 I cleaned up the environment for OS scripts,
however I think that was a bit too extreme - it breaks our own
instance-debootstrap hooks, because for example dpkg (called from the
grub script) requires PATH to be set.

Instead of requiring every OS to define a path, let's set a default
PATH for the OS scripts, which should cover most common uses. A more
specialised PATH can be set, if needed, in the OS scripts.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent aa7b59ac
No related branches found
No related tags found
No related merge requests found
......@@ -2204,6 +2204,11 @@ def OSCoreEnv(os_name, inst_os, os_params, debug=0):
for pname, pvalue in os_params.items():
result["OSP_%s" % pname.upper()] = pvalue
# Set a default path otherwise programs called by OS scripts (or
# even hooks called from OS scripts) might break, and we don't want
# to have each script require setting a PATH variable
result["PATH"] = constants.HOOKS_PATH
return result
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment