From fd2b290fd08120234aa576f2a7eec66c3732b5f6 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 1 Jun 2023 11:12:31 -0500 Subject: [PATCH] Save datasync config with new keys, per RattailConfiguration --- tailbone/views/datasync.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tailbone/views/datasync.py b/tailbone/views/datasync.py index e6c31721..3a691218 100644 --- a/tailbone/views/datasync.py +++ b/tailbone/views/datasync.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2022 Lance Edgar +# Copyright © 2010-2023 Lance Edgar # # This file is part of Rattail. # @@ -24,13 +24,10 @@ DataSync Views """ -from __future__ import unicode_literals, absolute_import - import json import subprocess import logging -import six import sqlalchemy as sa from rattail.db import model @@ -117,7 +114,7 @@ class DataSyncThreadView(MasterView): watcher_data = [] consumer_data = [] now = app.localtime() - for key, profile in six.iteritems(profiles): + for key, profile in profiles.items(): watcher = profile.watcher lastrun = self.datasync_handler.get_watcher_lastrun( @@ -258,7 +255,7 @@ class DataSyncThreadView(MasterView): watch.append(pkey) settings.extend([ - {'name': 'rattail.datasync.{}.watcher'.format(pkey), + {'name': 'rattail.datasync.{}.watcher.spec'.format(pkey), 'value': profile['watcher_spec']}, {'name': 'rattail.datasync.{}.watcher.db'.format(pkey), 'value': profile['watcher_dbkey']}, @@ -289,7 +286,7 @@ class DataSyncThreadView(MasterView): if consumer['enabled']: consumers.append(ckey) settings.extend([ - {'name': 'rattail.datasync.{}.consumer.{}'.format(pkey, ckey), + {'name': 'rattail.datasync.{}.consumer.spec.{}'.format(pkey, ckey), 'value': consumer['consumer_spec']}, {'name': 'rattail.datasync.{}.consumer.{}.db'.format(pkey, ckey), 'value': consumer['consumer_dbkey']}, @@ -304,7 +301,7 @@ class DataSyncThreadView(MasterView): ]) settings.extend([ - {'name': 'rattail.datasync.{}.consumers'.format(pkey), + {'name': 'rattail.datasync.{}.consumers.list'.format(pkey), 'value': ', '.join(consumers)}, ])