Browse Source

[1976] Provide default configuration for static data source

So users don't have to set it up, but they can disable it if they want.
Michal 'vorner' Vaner 13 years ago
parent
commit
eabb375e7d
3 changed files with 14 additions and 2 deletions
  1. 1 0
      configure.ac
  2. 4 1
      src/bin/cfgmgr/plugins/Makefile.am
  3. 9 1
      src/bin/cfgmgr/plugins/datasrc.spec

+ 1 - 0
configure.ac

@@ -1137,6 +1137,7 @@ AC_CONFIG_FILES([Makefile
 AC_OUTPUT([doc/version.ent
            src/bin/cfgmgr/b10-cfgmgr.py
            src/bin/cfgmgr/tests/b10-cfgmgr_test.py
+           src/bin/cfgmgr/plugins/datasrc.spec.pre
            src/bin/cmdctl/cmdctl.py
            src/bin/cmdctl/run_b10-cmdctl.sh
            src/bin/cmdctl/tests/cmdctl_test

+ 4 - 1
src/bin/cfgmgr/plugins/Makefile.am

@@ -1,6 +1,9 @@
 SUBDIRS = tests
 
-EXTRA_DIST = README logging.spec tsig_keys.spec datasrc.spec
+EXTRA_DIST = README logging.spec tsig_keys.spec
+
+datasrc.spec: datasrc.spec.pre
+	$(SED) -e "s|@@PKGDATADIR@@|$(pkgdatadir)|" datasrc.spec.pre >$@
 
 config_plugindir = @prefix@/share/@PACKAGE@/config_plugins
 config_plugin_DATA = logging.spec tsig_keys.spec datasrc.spec

+ 9 - 1
src/bin/cfgmgr/plugins/datasrc.spec

@@ -7,7 +7,15 @@
                 "item_name": "classes",
                 "item_type": "named_set",
                 "item_optional": false,
-                "item_default": {},
+                "item_default": {
+                    "CH": [
+                        {
+                            "type": "static",
+                            "cache-enable": false,
+                            "params": "@@PKGDATADIR@@/static.zone"
+                        }
+                    ]
+                },
                 "named_set_item_spec": {
                     "item_name": "class",
                     "item_type": "list",