summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-09-25 20:08:59 +0200
committerGitHub <noreply@github.com>2020-09-25 20:08:59 +0200
commitcbb29ca10c1ec5853d7b665bb36dddf4301e27ff (patch)
treebf2b170e976401161c489ebd8d64dda7e5072a9f /docs
parentad5f61e19e1c29f6c639762f97126d2d44bb4f65 (diff)
downloadvyos-documentation-cbb29ca10c1ec5853d7b665bb36dddf4301e27ff.tar.gz
vyos-documentation-cbb29ca10c1ec5853d7b665bb36dddf4301e27ff.zip
development: update python skeleton
Diffstat (limited to 'docs')
-rw-r--r--docs/contributing/development.rst14
1 files changed, 10 insertions, 4 deletions
diff --git a/docs/contributing/development.rst b/docs/contributing/development.rst
index 17f5cc48..b382b131 100644
--- a/docs/contributing/development.rst
+++ b/docs/contributing/development.rst
@@ -271,7 +271,7 @@ device if you happen to be a crazy scientist.
#!/usr/bin/env python3
#
- # Copyright (C) 2019 VyOS maintainers and contributors
+ # Copyright (C) 2020 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -291,10 +291,16 @@ device if you happen to be a crazy scientist.
from vyos import ConfigError
def get_config():
- vc = Config()
+ if config:
+ conf = config
+ else:
+ conf = Config()
+
+ # Base path to CLI nodes
+ base = ['...', '...']
# Convert the VyOS config to an abstract internal representation
- config = ...
- return config
+ config_data = conf.get_config_dict(base, key_mangling=('-', '_'), get_first_key=True)
+ return config_data
def verify(config):
# Verify that configuration is valid