Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos and add constraints on conf-mode scripts under configd #1575

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions docs/contributing/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ device if you happen to be a crazy scientist.
from vyos.config import Config
from vyos import ConfigError

def get_config():
def get_config(config=None):
if config:
conf = config
else:
Expand All @@ -306,7 +306,6 @@ device if you happen to be a crazy scientist.
# Verify that configuration is valid
if invalid:
raise ConfigError("Descriptive message")
return True

def generate(config):
# Generate daemon configs
Expand Down Expand Up @@ -385,6 +384,24 @@ For easy orientation we suggest you take a look on the ``ntp.py`` or
``interfaces-bonding.py`` (for tag nodes) implementation. Both files can be
found in the vyos-1x_ repository.

Other considerations: vyos-configd
----------------------------------

All scripts now run under the config daemon and must conform to the
following:

1. The signature and initial four lines of ``get_config(...)`` `must` be as
above.

2. Each of ``get_config``, ``verify``, ``apply``, ``generate`` `must`
appear, with signatures as above, even if they are a no-op.

3. Instantiations of ``Config`` other than that in ``get_config`` `must not`
appear.

4. The legacy function ``my_set`` `must not` appear: modifications of the
active config `should not` appear in new code (if absolutely necessary,
alternative mechanisms may be used).

XML (used for CLI definitions)
==============================
Expand Down
Loading