123456789101112131415161718192021222324 |
- #!/usr/bin/python3
- import os
- import sys
- import yaml
- def migrate(values):
- if values["storage"].get("is_data_in_the_same_volume", False):
- raise Exception(
- "You are still using the old storage configuration. "
- "You need to migrate your storage configuration first in order to upgrade."
- )
- values["storage"].pop("is_data_in_the_same_volume")
- return values
- if __name__ == "__main__":
- if len(sys.argv) != 2:
- exit(1)
- if os.path.exists(sys.argv[1]):
- with open(sys.argv[1], "r") as f:
- print(yaml.dump(migrate(yaml.safe_load(f.read()))))
|