LGTM, thanks!

On Mon, Jan 13, 2014 at 10:26 AM, Klaus Aehlig <[email protected]> wrote:

> 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: Klaus Aehlig <[email protected]>
> ---
>  tools/post-upgrade | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/tools/post-upgrade b/tools/post-upgrade
> index 374cd08..6aec3ff 100644
> --- a/tools/post-upgrade
> +++ b/tools/post-upgrade
> @@ -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__":
> --
> 1.8.5.1
>
>

Reply via email to