From 901f7abcd5b6451ffa0d1bf3744996e262d7e597 Mon Sep 17 00:00:00 2001 From: Thor Harald Johansen Date: Wed, 27 May 2020 11:53:52 +0200 Subject: [PATCH] Update built-in default configuration to zasd.conf.py syntax --- src/zasd/config.py | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/zasd/config.py b/src/zasd/config.py index 332aa01..a094827 100644 --- a/src/zasd/config.py +++ b/src/zasd/config.py @@ -23,35 +23,36 @@ CONFIG_BASENAME = 'zasd.conf.py' CONFIG_FILENAMES = [CONFIG_BASENAME, '.' + CONFIG_BASENAME] # Default configuration -DEFAULT_CONFIG = { - 'zfs_path': '/usr/local/bin/zfs', - 'fswatch_path': '/usr/local/bin/fswatch', +DEFAULT_CONFIG = dict( + zfs_path = '/usr/local/bin/zfs', + fswatch_path = '/usr/local/bin/fswatch', - 'tab_size': 2, + tab_size = 2, - 'log_level': logging.INFO, - 'log_format': '%(asctime)s %(name)s [%(levelname)-8s]: %(message)s', - 'log_date_format': '%a, %d %b %Y, %H:%M:%S', + log_level = logging.INFO, + log_format = '%(asctime)s %(name)s [%(levelname)-8s]: %(message)s', + log_date_format = '%a, %d %b %Y, %H:%M:%S', - 'separator': ':', - 'destroy_trigger': CronTrigger.from_crontab('* * * * *'), + separator = ':', + destroy_trigger = CronTrigger.from_crontab('* * * * *'), # Defaults will take a snapshot every 12 hours # and keep them for a week, so if the config file # should disappear for some reason, there will # at least be _some_ recoverable snapshots - 'defaults': { - 'disabled': False, - 'filesystems': ['tank'], - 'recursive': True, - 'tag': 'zasd', - 'trigger': IntervalTrigger(hours=12), - 'priority': 1, - 'keep': 14 - }, - - 'schedules': [{}] -} + defaults = dict( + disabled = False, + filesystems = ['tank'], + recursive = True, + tag = 'zasd', + trigger = IntervalTrigger(hours=12), + if_modified = False, + priority = 1, + keep = 14 + ), + + schedules = [{}] +) # Load configuration def load_config():