Revision 24f6a6e6 tools/cfgupgrade
b/tools/cfgupgrade | ||
---|---|---|
32 | 32 |
import sys |
33 | 33 |
import optparse |
34 | 34 |
import logging |
35 |
import socket |
|
36 | 35 |
|
37 | 36 |
from ganeti import constants |
38 | 37 |
from ganeti import serializer |
... | ... | |
71 | 70 |
root_logger.addHandler(stderr_handler) |
72 | 71 |
|
73 | 72 |
|
74 |
def Cluster22To23(cluster): |
|
75 |
"""Upgrades the cluster object from 2.2 to 2.3. |
|
76 |
|
|
77 |
""" |
|
78 |
logging.info("Upgrading the cluster object") |
|
79 |
if "primary_ip_family" not in cluster: |
|
80 |
# Add primary ip family to config |
|
81 |
cluster["primary_ip_family"] = socket.AF_INET |
|
82 |
|
|
83 |
|
|
84 | 73 |
def main(): |
85 | 74 |
"""Main program. |
86 | 75 |
|
... | ... | |
161 | 150 |
|
162 | 151 |
elif config_major == 2 and config_minor == 2: |
163 | 152 |
logging.info("No changes necessary") |
164 |
# TODO: For Ganeti 2.3 uncomment the following line |
|
165 |
# Cluster22To23(config_data["cluster"]) |
|
166 | 153 |
|
167 | 154 |
else: |
168 | 155 |
raise Error("Configuration version %d.%d.%d not supported by this tool" % |
Also available in: Unified diff