Commit cb7bf458 authored by Ales Mrazek's avatar Ales Mrazek

doctest error solved

parent c1aac09f
......@@ -14,9 +14,9 @@ All examples are located in ``examples/`` directory.
Using Python virtual environment is recommended. Look at :ref:`installation`
================================
=================
example-data.json
================================
=================
``example-data.json`` is example of Json-encoded file, which is valid against `resolvers-yang` data model
......@@ -26,9 +26,9 @@ You can edit this Json and validate it against data model using::
No output means that ``example-data.json`` is valid.
================================
================
generate_conf.py
================================
================
The script will generate ``unbound.conf`` and ``kresd.conf`` resolvers configuration files.
......@@ -38,9 +38,9 @@ Run ``generate_conf.py`` script with path to Json file as parameter::
If generated ``unbound.conf`` is converted to JSON by ``unb_to_json.py`` script. The result does not have to be the same as input JSON for ``generate_conf.py`` script, because the configuration solely for Knot Resolver is ignored for Unbound.
============================
==============
unb_to_json.py
============================
==============
The script will convert Unbound configuration file ``unbound.conf`` to Json-encoded file ``unb-data.json``, which is validate with ``resolvers-yang`` data model.
As example configuration file can be used ``unbound.conf`` created by running ``generate_conf.py``
......
......@@ -8,7 +8,6 @@ Library Usage
os.chdir("../examples")
For better understanding, look at the :ref:`examples` and `Yangson library <https://yangson.labs.nic.cz/quickstart.html#>`_
=======
......
......@@ -389,7 +389,7 @@ def gen_kresd(data: dict):
if 'values' in hnt:
for val in hnt['values']:
if hnt['canonical'].value:
if 'canonical' in hnt and hnt['canonical'].value:
can_hint += "hints.set(\"{0} {1}\")\n".format(name, val.value)
else:
hint += "hints.set(\"{0} {1}\")\n".format(name, val.value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment