[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 1/3] backup: QEMU Backup Tool
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v2 1/3] backup: QEMU Backup Tool |
Date: |
Wed, 30 Aug 2017 12:21:33 +0800 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Tue, 08/29 22:13, Ishani Chugh wrote:
> +class BackupTool(object):
> + """BackupTool Class"""
> + def __init__(self, config_file=os.path.expanduser('~') +
> + '/.config/qemu/qemu-backup-config'):
> + if "QEMU_BACKUP_CONFIG" in os.environ:
> + self.config_file = os.environ["QEMU_BACKUP_CONFIG"]
> + else:
> + self.config_file = config_file
> + try:
> + if not os.path.isdir(os.path.dirname(self.config_file)):
> + os.makedirs(os.path.dirname(self.config_file))
> + except:
> + print("Cannot create config directory", file=sys.stderr)
> + sys.exit(1)
> + self.config = configparser.ConfigParser()
> + self.config.read(self.config_file)
I suggest adding versioning to the config file, so that a future update to this
tool can make an incompatible change without breaking older tool:
[general]
version=0.1
[guest_1]
...
[guest_2]
...
And only continue if the version is known.
Fam