LGTM, thanks.
On Mon, Oct 7, 2013 at 6:39 PM, Klaus Aehlig <[email protected]> wrote: > During upgrades, a file is written to disk on master that documents > the fact that an upgrade is currently in progress. Add a function > to parse it. > > Signed-off-by: Klaus Aehlig <[email protected]> > --- > lib/client/gnt_cluster.py | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py > index 4633c2d..6eeb4fc 100644 > --- a/lib/client/gnt_cluster.py > +++ b/lib/client/gnt_cluster.py > @@ -1746,6 +1746,25 @@ def _ExecuteCommands(fns): > fn() > > > +def _ReadIntentToUpgrade(): > + """Read the file documenting the intent to upgrade the cluster. > + > + @rtype: string or None > + @return: the version to upgrade to, if the file exists, and None > + otherwise. > + > + """ > + if not os.path.isfile(pathutils.INTENT_TO_UPGRADE): > + return None > + > + contentstring = utils.ReadFile(pathutils.INTENT_TO_UPGRADE) > + contents = utils.UnescapeAndSplit(contentstring) > + if len(contents) != 2: > + # file syntactically mal-formed > + return None > + return contents[0] > + > + > def _WriteIntentToUpgrade(version): > """Write file documenting the intent to upgrade the cluster. > > -- > 1.8.4 > > -- Thomas Thrainer | Software Engineer | [email protected] | Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
