databricks-cli/libs/databrickscfg
Pieter Noordhuis a17876480a
Include [DEFAULT] section header when writing ~/.databrickscfg (#464)
## Changes

The ini library omits the default section header and in doing so breaks
compatibility with Python's config parser. It raises:

```
Error: MissingSectionHeaderError: File contains no section headers.
```

This commit makes sure the DEFAULT section header is included.

If the config file doesn't include a DEFAULT section itself, we include
a comment describing its purpose.

## Tests

New tests pass. Manually confirmed the DEFAULT section header is
included.

---------

Co-authored-by: PaulCornellDB <paul.cornell@databricks.com>
2023-06-13 16:41:56 +00:00
..
testdata Add profile on `databricks auth login` (#423) 2023-06-02 13:49:39 +02:00
host.go Try to resolve a profile if only the host is specified (#287) 2023-03-29 20:44:19 +02:00
host_test.go Try to resolve a profile if only the host is specified (#287) 2023-03-29 20:44:19 +02:00
loader.go Add profile on `databricks auth login` (#423) 2023-06-02 13:49:39 +02:00
loader_test.go Add profile on `databricks auth login` (#423) 2023-06-02 13:49:39 +02:00
ops.go Include [DEFAULT] section header when writing ~/.databrickscfg (#464) 2023-06-13 16:41:56 +00:00
ops_test.go Include [DEFAULT] section header when writing ~/.databrickscfg (#464) 2023-06-13 16:41:56 +00:00
profiles.go Tweak profile prompt (#454) 2023-06-09 13:56:35 +02:00
profiles_test.go Tweak profile prompt (#454) 2023-06-09 13:56:35 +02:00