development: update python skeleton

This commit is contained in:
Christian Poessinger 2020-09-25 20:08:59 +02:00 committed by GitHub
parent ad5f61e19e
commit cbb29ca10c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,7 +271,7 @@ device if you happen to be a crazy scientist.
#!/usr/bin/env python3 #!/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 # 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 # 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 from vyos import ConfigError
def get_config(): 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 # Convert the VyOS config to an abstract internal representation
config = ... config_data = conf.get_config_dict(base, key_mangling=('-', '_'), get_first_key=True)
return config return config_data
def verify(config): def verify(config):
# Verify that configuration is valid # Verify that configuration is valid