Revision b121199d tools/post-upgrade

b/tools/post-upgrade
25 25

  
26 26
"""
27 27

  
28
import sys
29

  
30
from ganeti import utils
31
from ganeti import cli
32

  
28 33

  
29 34
def main():
30 35
  """Main program.
31 36

  
32 37
  """
38
  if len(sys.argv) != 2:
39
    cli.ToStderr("Expecting precisely one argument, the version upgrading from")
40
    return 1
41
  versionstring = sys.argv[1]
42

  
43
  version = utils.version.ParseVersion(versionstring)
44

  
45
  if utils.version.IsBefore(version, 2, 11, 0):
46
    result = utils.RunCmd(["gnt-cluster", "renew-crypto",
47
                           "--new-node-certificates", "-f"])
48
    if result.failed:
49
      cli.ToStderr("Failed to create node certificates: %s; Output %s" %
50
                   (result.fail_reason, result.output))
33 51
  return 0
34 52

  
35 53
if __name__ == "__main__":

Also available in: Unified diff