mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Flat CVs: represent null as "null", not "<nil>"
This commit is contained in:
parent
da030805b5
commit
188ce4cb4b
1 changed files with 8 additions and 2 deletions
|
|
@ -58,7 +58,13 @@ func FlattenCustomvars(ctx context.Context, cvs <-chan contracts.Entity) (<-chan
|
|||
flattened := flatten.Flatten(value, customvar.Name)
|
||||
|
||||
for flatname, flatvalue := range flattened {
|
||||
flatvalue := fmt.Sprintf("%v", flatvalue)
|
||||
var fv string
|
||||
if flatvalue == nil {
|
||||
fv = "null"
|
||||
} else {
|
||||
fv = fmt.Sprintf("%v", flatvalue)
|
||||
}
|
||||
|
||||
select {
|
||||
case cvFlats <- &CustomvarFlat{
|
||||
CustomvarMeta: CustomvarMeta{
|
||||
|
|
@ -76,7 +82,7 @@ func FlattenCustomvars(ctx context.Context, cvs <-chan contracts.Entity) (<-chan
|
|||
},
|
||||
Flatname: flatname,
|
||||
FlatnameChecksum: utils.Checksum(flatname),
|
||||
Flatvalue: flatvalue,
|
||||
Flatvalue: fv,
|
||||
}:
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
|
|
|
|||
Loading…
Reference in a new issue