From fb32a8fe0be550ccd88a3063824f3f1f63d9380b Mon Sep 17 00:00:00 2001 From: Scott Kitterman Date: Sun, 4 Mar 2018 13:56:06 -0500 Subject: [PATCH] Implement detection of type db datasets, but not used yet --- dkimpy_milter/config.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dkimpy_milter/config.py b/dkimpy_milter/config.py index d17c6ce..e49b459 100644 --- a/dkimpy_milter/config.py +++ b/dkimpy_milter/config.py @@ -118,7 +118,20 @@ def _dataset_to_list(dataset): return [dataset[4:].strip().strip(',')] else: return [dataset.strip().strip(',')] - + if dataset[-3:] == '.db' or dataset[:3] == 'db:': + # This is a Sleepycat (Oracle) DB dataset + import whichdb # Will need rewriting someday for python3 + if dataset[-3:] == '.db': + dbname = dataset + elif dataset[:3] == 'db:': + dbname = dataset[3:] + else: + raise dkim.ParameterError('Unimplmented dataset type: {0}'.format(type(dataset))) + if whichdb.whichdb(dbname) != 'dbhash': + raise dkim.ParameterError('Unimplmented dataset type: {0}'.format(type(dataset))) + #TODO replace this with code to use db maps + raise dkim.ParameterError('Unsupported dataset db dataset not yet used: {0}'.format(type(dataset))) + raise dkim.ParameterError('Unimplmented dataset type: {0}'.format(type(dataset))) ###############################################################