From 4bc613367b2c641ff0d5c7d197959d5cba51038c Mon Sep 17 00:00:00 2001 From: Victor Skvortsov Date: Wed, 14 Feb 2024 14:42:58 +0500 Subject: [PATCH] Exclude None when writing init server config Users will see no parameter set instead of seeing `key: null` in config.yml (cherry picked from commit b7af905a534e74258f55e09f9479aad8337448a8) --- src/dstack/_internal/server/services/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dstack/_internal/server/services/config.py b/src/dstack/_internal/server/services/config.py index 7f4d0bc37..a7d2db2c7 100644 --- a/src/dstack/_internal/server/services/config.py +++ b/src/dstack/_internal/server/services/config.py @@ -272,7 +272,7 @@ def seq_representer(dumper, sequence): yaml.add_representer(list, seq_representer) with open(settings.SERVER_CONFIG_FILE_PATH, "w+") as f: - yaml.dump(config.dict(), f, sort_keys=False) + yaml.dump(config.dict(exclude_none=True), f, sort_keys=False) server_config_manager = ServerConfigManager()