Revision 2c9cf6bb
b/tools/cfgupgrade | ||
---|---|---|
32 | 32 |
import sys |
33 | 33 |
import optparse |
34 | 34 |
import logging |
35 |
import socket |
|
35 | 36 |
|
36 | 37 |
from ganeti import constants |
37 | 38 |
from ganeti import serializer |
... | ... | |
70 | 71 |
root_logger.addHandler(stderr_handler) |
71 | 72 |
|
72 | 73 |
|
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 |
|
|
73 | 84 |
def main(): |
74 | 85 |
"""Main program. |
75 | 86 |
|
... | ... | |
150 | 161 |
|
151 | 162 |
elif config_major == 2 and config_minor == 2: |
152 | 163 |
logging.info("No changes necessary") |
164 |
# TODO: For Ganeti 2.3 uncomment the following line |
|
165 |
# Cluster22To23(config_data["cluster"]) |
|
153 | 166 |
|
154 | 167 |
else: |
155 | 168 |
raise Error("Configuration version %d.%d.%d not supported by this tool" % |
Also available in: Unified diff