Revision 36cfb584

b/lib/client/gnt_cluster.py
1746 1746
    fn()
1747 1747

  
1748 1748

  
1749
def _ReadIntentToUpgrade():
1750
  """Read the file documenting the intent to upgrade the cluster.
1751

  
1752
  @rtype: string or None
1753
  @return: the version to upgrade to, if the file exists, and None
1754
      otherwise.
1755

  
1756
  """
1757
  if not os.path.isfile(pathutils.INTENT_TO_UPGRADE):
1758
    return None
1759

  
1760
  contentstring = utils.ReadFile(pathutils.INTENT_TO_UPGRADE)
1761
  contents = utils.UnescapeAndSplit(contentstring)
1762
  if len(contents) != 2:
1763
    # file syntactically mal-formed
1764
    return None
1765
  return contents[0]
1766

  
1767

  
1749 1768
def _WriteIntentToUpgrade(version):
1750 1769
  """Write file documenting the intent to upgrade the cluster.
1751 1770

  

Also available in: Unified diff