From 07e0fb06d9069fd4ea0aebb2ac357dbdfc2ba211 Mon Sep 17 00:00:00 2001 From: Ye Cao Date: Mon, 19 Feb 2024 12:53:19 +0800 Subject: [PATCH] Add a default value for the VINEYARD_CONFIG while connecting. (#1761) Fixes #1750 Signed-off-by: Ye Cao --- python/vineyard/core/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/vineyard/core/client.py b/python/vineyard/core/client.py index cd73821d..c7690bf5 100644 --- a/python/vineyard/core/client.py +++ b/python/vineyard/core/client.py @@ -149,7 +149,8 @@ def __init__( a path to a directory containing the default config file `vineyard.yaml`. Also, the environment variable `VINEYARD_CONFIG` can be used to specify the - path to the configuration file. + path to the configuration file. If not defined, the default + config file `/var/run/vineyard/config.yaml` will be used. The content of the configuration file should has the following content: @@ -178,7 +179,7 @@ def __init__( if not endpoint and not (host and port): endpoint = os.getenv('VINEYARD_RPC_ENDPOINT', None) if not config: - config = os.getenv('VINEYARD_CONFIG', None) + config = os.getenv('VINEYARD_CONFIG', '/var/run/vineyard/config.yaml') if endpoint: if not isinstance(endpoint, (tuple, list)): endpoint = endpoint.split(':')