diff options
-rw-r--r-- | python/vyos/configverify.py | 11 | ||||
-rwxr-xr-x | src/services/vyos-http-api-server | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py index 30bdd2d47..fcc8cc733 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -420,11 +420,12 @@ def verify_accel_ppp_base_service(config, local_users=True): if 'gateway_address' in config: gateway = True else: - if dict_search_recursive(config, 'gateway_address', ['client_ip_pool', 'name']): - for _, v in config['client_ip_pool']['name'].items(): - if 'gateway_address' in v: - gateway = True - break + if 'client_ip_pool' in config: + if dict_search_recursive(config, 'gateway_address', ['client_ip_pool', 'name']): + for _, v in config['client_ip_pool']['name'].items(): + if 'gateway_address' in v: + gateway = True + break if not gateway: raise ConfigError('Server requires gateway-address to be configured!') diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server index f59e089ae..cd73f38ec 100755 --- a/src/services/vyos-http-api-server +++ b/src/services/vyos-http-api-server @@ -425,7 +425,7 @@ async def validation_exception_handler(request, exc): return error(400, str(exc.errors()[0])) @app.post('/configure') -def configure_op(data: Union[ConfigureModel, ConfigureListModel]): +async def configure_op(data: Union[ConfigureModel, ConfigureListModel]): session = app.state.vyos_session env = session.get_session_env() config = vyos.config.Config(session_env=env) @@ -494,7 +494,7 @@ def configure_op(data: Union[ConfigureModel, ConfigureListModel]): return success(None) @app.post("/retrieve") -def retrieve_op(data: RetrieveModel): +async def retrieve_op(data: RetrieveModel): session = app.state.vyos_session env = session.get_session_env() config = vyos.config.Config(session_env=env) |