Preserve client sent config appropriately (#8566)

This commit is contained in:
Harshavardhana
2019-11-22 13:46:05 -08:00
committed by kannappanr
parent c3771df641
commit 0a56e33ce1
2 changed files with 4 additions and 7 deletions

View File

@@ -466,14 +466,10 @@ func (c Config) SetKVS(s string, defaultKVS map[string]KVS) error {
tgt = subSystemValue[1]
}
_, ok := c[subSys][tgt]
if !ok {
c[subSys][tgt] = KVS{}
} else {
c[subSys][tgt] = kvs
}
// Save client sent kvs
c[subSys][tgt] = kvs
_, ok = c[subSys][tgt].Lookup(State)
_, ok := c[subSys][tgt].Lookup(State)
if !ok {
// implicit state "on" if not specified.
c[subSys][tgt] = append(c[subSys][tgt], KV{