diff --git a/NEWS b/NEWS index 153ff35d2cb633b0d1babd5ae2c2abfd3282ccfa..ca719a8392096f336c7ce5a4e6ce11136038ba19 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,9 @@ Version 2.5.0 beta1 *(unreleased)* + +Incompatible/important changes: + - The default of the ``/2/instances/[instance_name]/rename`` RAPI resource's ``ip_check`` parameter changed from ``True`` to ``False`` to match the underlying LUXI interface @@ -26,6 +29,9 @@ Version 2.5.0 beta1 - The "cluster-verify" hooks are now executed per group by the OP_CLUSTER_VERIFY_GROUP opcode. This maintains the same behavior if you just run "gnt-cluster verify", which generates one op per group. +- The environment as passed to the OS scripts is cleared, and thus no + environment variables defined in the node daemon's environment will be + inherited by the scripts Version 2.4.3 diff --git a/lib/backend.py b/lib/backend.py index 30fe8fffbe0722174b552ca622a0467afba2e031..89dbe46cd9ddfcd300578c8f9b64ddb5678be483 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -966,7 +966,7 @@ def InstanceOsAdd(instance, reinstall, debug): logfile = _InstanceLogName("add", instance.os, instance.name) result = utils.RunCmd([inst_os.create_script], env=create_env, - cwd=inst_os.path, output=logfile,) + cwd=inst_os.path, output=logfile, reset_env=True) if result.failed: logging.error("os create command '%s' returned error: %s, logfile: %s," " output: %s", result.cmd, result.fail_reason, logfile, @@ -999,7 +999,7 @@ def RunRenameInstance(instance, old_name, debug): "%s-%s" % (old_name, instance.name)) result = utils.RunCmd([inst_os.rename_script], env=rename_env, - cwd=inst_os.path, output=logfile) + cwd=inst_os.path, output=logfile, reset_env=True) if result.failed: logging.error("os create command '%s' returned error: %s output: %s", @@ -2752,7 +2752,7 @@ def ValidateOS(required, osname, checks, osparams): validate_env = OSCoreEnv(osname, tbv, osparams) result = utils.RunCmd([tbv.verify_script] + checks, env=validate_env, - cwd=tbv.path) + cwd=tbv.path, reset_env=True) if result.failed: logging.error("os validate command '%s' returned error: %s output: %s", result.cmd, result.fail_reason, result.output) diff --git a/man/ganeti-os-interface.rst b/man/ganeti-os-interface.rst index 44267663e3f5f7dafd0bf96d543f8fb7d7c2938e..000880ca7171690767c3d23e099c76dd214f0705 100644 --- a/man/ganeti-os-interface.rst +++ b/man/ganeti-os-interface.rst @@ -30,6 +30,12 @@ common set of variables will be exported for all commands, and some of them might have extra ones. Note that all counts are zero-based. +Since Ganeti version 2.5, the environment will be cleaned up before +being passed to scripts, therefore they will not inherit the environment +in with which the ganeti node daemon was started. If you depend on any +environment variables (non-Ganeti), then you will need to define or +source them appropriately. + OS_API_VERSION The OS API version that the rest of the environment conforms to.