Commit fe5ca2bb authored by Andrea Spadaccini's avatar Andrea Spadaccini
Browse files

Move hooks PATH environment variable to constants

Move the contents of the PATH environment variable for hooks to
constants, and use its value in the code and in the hooks documentation.
Signed-off-by: default avatarAndrea Spadaccini <>
Reviewed-by: default avatarGuido Trotter <>
parent 2a6de57a
......@@ -98,7 +98,7 @@ The scripts will be run as follows:
- stdout and stderr are directed to files
- PATH is reset to ``/sbin:/bin:/usr/sbin:/usr/bin``
- PATH is reset to :pyeval:`constants.HOOKS_PATH`
- the environment is cleared, and only ganeti-specific variables will
be left
......@@ -332,6 +332,7 @@ HOOKS_PHASE_POST = "post"
HOOKS_NAME_CFGUPDATE = "config-update"
HOOKS_PATH = "/sbin:/bin:/usr/sbin:/usr/bin"
# hooks subject type (what object type does the LU deal with)
......@@ -561,7 +561,7 @@ class HooksMaster(object):
env = {
"PATH": "/sbin:/bin:/usr/sbin:/usr/bin",
"PATH": constants.HOOKS_PATH,
"GANETI_OP_CODE": self.opcode,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment