Commit b121199d authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Add generating node certificates as post-upgrade task



While, technically, Ganeti is still working without individual node
certificates, it is considered an error by gnt-cluster verify to
not have it done immediately after upgrading. So, to make automatic
upgrading work, add it as a post-upgrade hook when upgrading from
before version 2.11.0.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent 9b85ede9
......@@ -25,11 +25,29 @@
"""
import sys
from ganeti import utils
from ganeti import cli
def main():
"""Main program.
"""
if len(sys.argv) != 2:
cli.ToStderr("Expecting precisely one argument, the version upgrading from")
return 1
versionstring = sys.argv[1]
version = utils.version.ParseVersion(versionstring)
if utils.version.IsBefore(version, 2, 11, 0):
result = utils.RunCmd(["gnt-cluster", "renew-crypto",
"--new-node-certificates", "-f"])
if result.failed:
cli.ToStderr("Failed to create node certificates: %s; Output %s" %
(result.fail_reason, result.output))
return 0
if __name__ == "__main__":
......
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