datasrc_config_plugin.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright (C) 2012 Internet Systems Consortium.
  2. #
  3. # Permission to use, copy, modify, and distribute this software for any
  4. # purpose with or without fee is hereby granted, provided that the above
  5. # copyright notice and this permission notice appear in all copies.
  6. #
  7. # THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SYSTEMS CONSORTIUM
  8. # DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
  9. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
  10. # INTERNET SYSTEMS CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
  11. # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
  12. # FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  13. # NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  14. # WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. from isc.config.module_spec import module_spec_from_file
  16. from isc.util.file import path_search
  17. from bind10_config import PLUGIN_PATHS
  18. spec = module_spec_from_file(path_search('datasrc.spec', PLUGIN_PATHS))
  19. def check(config):
  20. """
  21. Check the configuration.
  22. """
  23. # TODO: Once we have solved ticket #2051, create the list and
  24. # fill it with the configuration. We probably want to have some way
  25. # to not load the data sources, just the configuration. It could
  26. # be hacked together by subclassing ConfigurableClientList and
  27. # having empty getDataSource method. But it looks like a hack and it
  28. # won't really check the params configuration.
  29. #
  30. # For now, we let everything pass.
  31. return None
  32. def load():
  33. return (spec, check)