2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-10-01 11:22:13 +00:00

[#1240] Added access in command JSON files

This commit is contained in:
Francis Dupont
2020-05-17 19:17:15 +02:00
committed by Tomek Mrugalski
parent 7b5756b58d
commit 20cd5ab4d9
170 changed files with 212 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2019-2020 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -108,6 +108,17 @@ API Reference
rst += '(:ref:`%s <commands-%s>` hook library)' % (func['hook'], func['hook']) if 'hook' in func else '(built-in)'
rst += '\n\n'
# access
try:
access = func['access']
except:
print('\naccess missing in %s\n\n' % name)
raise
if not access in ['read', 'write']:
print('\nUnknown access %s in %s\n\n' % (access, name))
raise ValueError('access must be read or write')
rst += 'Access: %s\n' % access
# description and examples
rst += 'Description and examples: see :ref:`%s command <command-%s>`\n\n' % (name, name)