Revision 16e81432
b/lib/client/gnt_cluster.py | ||
---|---|---|
45 | 45 |
from ganeti import netutils |
46 | 46 |
from ganeti import ssconf |
47 | 47 |
from ganeti import pathutils |
48 |
from ganeti import serializer |
|
48 | 49 |
from ganeti import qlang |
49 | 50 |
|
50 | 51 |
|
... | ... | |
1746 | 1747 |
fn() |
1747 | 1748 |
|
1748 | 1749 |
|
1750 |
def _GetConfigVersion(): |
|
1751 |
"""Determine the version the configuration file currently has. |
|
1752 |
|
|
1753 |
@rtype: tuple or None |
|
1754 |
@return: (major, minor, revision) if the version can be determined, |
|
1755 |
None otherwise |
|
1756 |
|
|
1757 |
""" |
|
1758 |
config_data = serializer.LoadJson(utils.ReadFile(pathutils.CLUSTER_CONF_FILE)) |
|
1759 |
try: |
|
1760 |
config_version = config_data["version"] |
|
1761 |
except KeyError: |
|
1762 |
return None |
|
1763 |
return utils.SplitVersion(config_version) |
|
1764 |
|
|
1765 |
|
|
1749 | 1766 |
def _ReadIntentToUpgrade(): |
1750 | 1767 |
"""Read the file documenting the intent to upgrade the cluster. |
1751 | 1768 |
|
Also available in: Unified diff