From fdc25777daeeda8acb6d5196ed07c6b2fb23a896 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 3 Jul 2016 12:19:01 +0800 Subject: [PATCH] master/dataset_db: support keeping old persist flag --- artiq/master/databases.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artiq/master/databases.py b/artiq/master/databases.py index 5e2c7d004..9ad0c1be3 100644 --- a/artiq/master/databases.py +++ b/artiq/master/databases.py @@ -57,7 +57,12 @@ class DatasetDB(TaskObject): process_mod(self.data, mod) # convenience functions (update() can be used instead) - def set(self, key, value, persist=False): + def set(self, key, value, persist=None): + if persist is None: + if key in self.data.read: + persist = self.data.read[key][0] + else: + persist = False self.data[key] = (persist, value) def delete(self, key):