Skip to content

Commit

Permalink
Exclude None when writing init server config
Browse files Browse the repository at this point in the history
Users will see no parameter set instead of seeing `key: null` in config.yml

(cherry picked from commit b7af905)
  • Loading branch information
r4victor authored and peterschmidt85 committed Feb 14, 2024
1 parent 73c2d62 commit 4bc6133
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dstack/_internal/server/services/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4bc6133

Please sign in to comment.