Revision 30448dc7
b/tools/cfgupgrade | ||
---|---|---|
260 | 260 |
UpgradeInstances(config_data) |
261 | 261 |
|
262 | 262 |
|
263 |
def DowngradeDisks(disks, owner): |
|
264 |
for disk in disks: |
|
265 |
# Remove spindles to downgrade to 2.8 |
|
266 |
if "spindles" in disk: |
|
267 |
logging.warning("Removing spindles (value=%s) from disk %s (%s) of" |
|
268 |
" instance %s", |
|
269 |
disk["spindles"], disk["iv_name"], disk["uuid"], owner) |
|
270 |
del disk["spindles"] |
|
271 |
|
|
272 |
|
|
273 |
def DowngradeInstances(config_data): |
|
274 |
if "instances" not in config_data: |
|
275 |
raise Error("Cannot find the 'instances' key in the configuration!") |
|
276 |
for (iname, iobj) in config_data["instances"].items(): |
|
277 |
if "disks" not in iobj: |
|
278 |
raise Error("Cannot find 'disks' key for instance %s" % iname) |
|
279 |
DowngradeDisks(iobj["disks"], iname) |
|
280 |
|
|
281 |
|
|
263 | 282 |
def DowngradeAll(config_data): |
264 |
# Unused arguments, pylint: disable=W0613 |
|
265 | 283 |
# Any code specific to a particular version should be labeled that way, so |
266 | 284 |
# it can be removed when updating to the next version. |
267 |
pass
|
|
285 |
DowngradeInstances(config_data)
|
|
268 | 286 |
|
269 | 287 |
|
270 | 288 |
def main(): |
Also available in: Unified diff