BIND 10 trac1976, updated. 8fa13ec3115f58573bc2fd6213a99be1c8435462 [1976] Spec file for data sources
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jun 18 14:40:09 UTC 2012
The branch, trac1976 has been updated
via 8fa13ec3115f58573bc2fd6213a99be1c8435462 (commit)
from c558fd6d7a67fa70d3ba78f43c6536f5c006fd3d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8fa13ec3115f58573bc2fd6213a99be1c8435462
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Mon Jun 18 16:07:58 2012 +0200
[1976] Spec file for data sources
-----------------------------------------------------------------------
Summary of changes:
src/bin/cfgmgr/plugins/Makefile.am | 6 +--
.../bin/cfgmgr/plugins/datasrc.py | 31 ++++++++++-----
src/bin/cfgmgr/plugins/datasrc.spec | 41 ++++++++++++++++++++
src/bin/cfgmgr/plugins/tests/Makefile.am | 2 +-
4 files changed, 66 insertions(+), 14 deletions(-)
copy tests/lettuce/run_lettuce.sh => src/bin/cfgmgr/plugins/datasrc.py (51%)
mode change 100755 => 100644
create mode 100644 src/bin/cfgmgr/plugins/datasrc.spec
-----------------------------------------------------------------------
diff --git a/src/bin/cfgmgr/plugins/Makefile.am b/src/bin/cfgmgr/plugins/Makefile.am
index 5a4cfef..a6a3362 100644
--- a/src/bin/cfgmgr/plugins/Makefile.am
+++ b/src/bin/cfgmgr/plugins/Makefile.am
@@ -1,11 +1,11 @@
SUBDIRS = tests
-EXTRA_DIST = README logging.spec tsig_keys.spec
+EXTRA_DIST = README logging.spec tsig_keys.spec datasrc.spec
config_plugindir = @prefix@/share/@PACKAGE@/config_plugins
-config_plugin_DATA = logging.spec tsig_keys.spec
+config_plugin_DATA = logging.spec tsig_keys.spec datasrc.spec
-python_PYTHON = b10logging.py tsig_keys.py
+python_PYTHON = b10logging.py tsig_keys.py datasrc.py
pythondir = $(config_plugindir)
CLEANFILES = b10logging.pyc tsig_keys.pyc
diff --git a/src/bin/cfgmgr/plugins/datasrc.py b/src/bin/cfgmgr/plugins/datasrc.py
new file mode 100644
index 0000000..f675aba
--- /dev/null
+++ b/src/bin/cfgmgr/plugins/datasrc.py
@@ -0,0 +1,36 @@
+# Copyright (C) 2012 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
+# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+from isc.config.module_spec import module_spec_from_file
+from isc.util.file import path_search
+from bind10_config import PLUGIN_PATHS
+spec = module_spec_from_file(path_search('datasrc.spec', PLUGIN_PATHS))
+
+def check(config):
+ """
+ Check the configuration.
+ """
+ # TODO: Once we have solved ticket #2051, create the list and
+ # fill it with the configuration. We probably want to have some way
+ # to not load the data sources, just the configuration. It could
+ # be hacked together by subclassing ConfigurableClientList and
+ # having empty getDataSource method. But it looks like a hack and it
+ # won't really check the params configuration.
+ #
+ # For now, we let everything pass.
+ return None
+
+def load():
+ return (spec, check)
diff --git a/src/bin/cfgmgr/plugins/datasrc.spec b/src/bin/cfgmgr/plugins/datasrc.spec
new file mode 100644
index 0000000..b85330e
--- /dev/null
+++ b/src/bin/cfgmgr/plugins/datasrc.spec
@@ -0,0 +1,41 @@
+{
+ "module_spec": {
+ "module_name": "data_sources",
+ "module_description": "The sources of authoritative DNS data",
+ "config_data": [
+ {
+ "item_name": "classes",
+ "item_type": "named_set",
+ "item_optional": false,
+ "item_default": {},
+ "named_set_item_spec": {
+ "item_name": "class",
+ "item_type": "list",
+ "item_optional": false,
+ "item_default": [],
+ "list_item_spec": {
+ "item_name": "source",
+ "item_type": "map",
+ "item_optional": false,
+ "item_default": {},
+ "map_item_spec": [
+ {
+ "item_name": "type",
+ "item_type": "string",
+ "item_optional": false,
+ "item_default": ""
+ },
+ {
+ "item_name": "params",
+ "item_type": "any",
+ "item_optional": false,
+ "item_default": null
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "commands": []
+ }
+}
diff --git a/src/bin/cfgmgr/plugins/tests/Makefile.am b/src/bin/cfgmgr/plugins/tests/Makefile.am
index ffea2d7..9b8b925 100644
--- a/src/bin/cfgmgr/plugins/tests/Makefile.am
+++ b/src/bin/cfgmgr/plugins/tests/Makefile.am
@@ -1,5 +1,5 @@
PYCOVERAGE_RUN = @PYCOVERAGE_RUN@
-PYTESTS = tsig_keys_test.py logging_test.py
+PYTESTS = tsig_keys_test.py logging_test.py datasrc_test.py
EXTRA_DIST = $(PYTESTS)
More information about the bind10-changes
mailing list