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 <spadaccio@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
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_NAME_WATCHER = "watcher"
HOOKS_VERSION = 2
HOOKS_PATH = "/sbin:/bin:/usr/sbin:/usr/bin"
# hooks subject type (what object type does the LU deal with)
HTYPE_CLUSTER = "CLUSTER"
......
......@@ -561,7 +561,7 @@ class HooksMaster(object):
"""
env = {
"PATH": "/sbin:/bin:/usr/sbin:/usr/bin",
"PATH": constants.HOOKS_PATH,
"GANETI_HOOKS_VERSION": constants.HOOKS_VERSION,
"GANETI_OP_CODE": self.opcode,
"GANETI_DATA_DIR": constants.DATA_DIR,
......
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