NormalizeInventoryStyle validates and canonicalizes inventory style.
(style string)
| 335 | |
| 336 | // NormalizeInventoryStyle validates and canonicalizes inventory style. |
| 337 | func NormalizeInventoryStyle(style string) string { |
| 338 | switch strings.ToLower(strings.TrimSpace(style)) { |
| 339 | case InventoryStyleExpanded: |
| 340 | return InventoryStyleExpanded |
| 341 | case InventoryStyleCompact: |
| 342 | return InventoryStyleCompact |
| 343 | default: |
| 344 | return InventoryStyleCompact |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | func renderINIInventory(groups map[string][]InventoryHost, allHosts []InventoryHost, style string) string { |
| 349 | orderedGroups := make([]string, 0, len(groups)) |
no outgoing calls