mirror of https://github.com/databricks/cli.git
This reverts changes from #513 which ended up not being necessary.
This commit is contained in:
parent
d23d4aef3a
commit
ae13135fc6
|
@ -76,9 +76,6 @@ func (l profileFromHostLoader) Configure(cfg *config.Config) error {
|
|||
// Normalized version of the configured host.
|
||||
host := normalizeHost(cfg.Host)
|
||||
match, err := findMatchingProfile(configFile, func(s *ini.Section) bool {
|
||||
if cfg.Profile != "" {
|
||||
return cfg.Profile == s.Name()
|
||||
}
|
||||
key, err := s.GetKey("host")
|
||||
if err != nil {
|
||||
log.Tracef(ctx, "section %s: %s", s.Name(), err)
|
||||
|
|
|
@ -89,6 +89,8 @@ func SaveToProfile(ctx context.Context, cfg *config.Config) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// zeroval profile name before adding it to a section
|
||||
cfg.Profile = ""
|
||||
cfg.ConfigFile = ""
|
||||
|
||||
// clear old keys in case we're overriding the section
|
||||
|
@ -97,7 +99,7 @@ func SaveToProfile(ctx context.Context, cfg *config.Config) error {
|
|||
}
|
||||
|
||||
for _, attr := range config.ConfigAttributes {
|
||||
if attr.IsZero(cfg) || attr.Name == "profile" {
|
||||
if attr.IsZero(cfg) {
|
||||
continue
|
||||
}
|
||||
key := section.Key(attr.Name)
|
||||
|
|
Loading…
Reference in New Issue