mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-05-02 09:28:31 +02:00
Fix so-yaml get to print scalar values without YAML document end marker
This commit is contained in:
@@ -346,7 +346,10 @@ def get(args):
|
|||||||
print(f"Key '{key}' not found by so-yaml.py", file=sys.stderr)
|
print(f"Key '{key}' not found by so-yaml.py", file=sys.stderr)
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
print(yaml.safe_dump(output))
|
if isinstance(output, (dict, list)):
|
||||||
|
print(yaml.safe_dump(output).strip())
|
||||||
|
else:
|
||||||
|
print(output)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ migrate_pcap_to_suricata() {
|
|||||||
|
|
||||||
for pillar_file in "$PCAPFILE" "$MINIONDIR"/*.sls; do
|
for pillar_file in "$PCAPFILE" "$MINIONDIR"/*.sls; do
|
||||||
[[ -f "$pillar_file" ]] || continue
|
[[ -f "$pillar_file" ]] || continue
|
||||||
pcap_enabled=$(so-yaml.py get "$pillar_file" pcap.enabled 2>/dev/null | head -1) || continue
|
pcap_enabled=$(so-yaml.py get "$pillar_file" pcap.enabled 2>/dev/null) || continue
|
||||||
so-yaml.py add "$pillar_file" suricata.pcap.enabled "$pcap_enabled"
|
so-yaml.py add "$pillar_file" suricata.pcap.enabled "$pcap_enabled"
|
||||||
so-yaml.py remove "$pillar_file" pcap
|
so-yaml.py remove "$pillar_file" pcap
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user