mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Set write_needed flag correctly, include newline in so-status.conf string
This commit is contained in:
@@ -106,12 +106,12 @@ def mod_so_status(action: str, items: str):
|
|||||||
containers = conf.readlines()
|
containers = conf.readlines()
|
||||||
|
|
||||||
for item in items:
|
for item in items:
|
||||||
if f'so-{item}' in containers:
|
if f'so-{item}\n' in containers:
|
||||||
if action == 'remove': containers.remove(f'so-{item}')
|
if action == 'remove': containers.remove(f'so-{item}\n')
|
||||||
if action == 'add': pass
|
if action == 'add': pass
|
||||||
else:
|
else:
|
||||||
if action == 'remove': pass
|
if action == 'remove': pass
|
||||||
if action == 'add': containers.append(f'so-{item}')
|
if action == 'add': containers.append(f'so-{item}\n')
|
||||||
|
|
||||||
conf.seek(0)
|
conf.seek(0)
|
||||||
conf.truncate(0)
|
conf.truncate(0)
|
||||||
@@ -180,7 +180,7 @@ def enable_disable_modules(args, enable: bool):
|
|||||||
else:
|
else:
|
||||||
pillar_modules[module]['enabled'] = enable
|
pillar_modules[module]['enabled'] = enable
|
||||||
mod_so_status(action_str, module)
|
mod_so_status(action_str, module)
|
||||||
write_needed = enable
|
write_needed = True
|
||||||
if write_needed:
|
if write_needed:
|
||||||
args.pillar_dict.update()
|
args.pillar_dict.update()
|
||||||
write_pillar(args.pillar, args.pillar_dict)
|
write_pillar(args.pillar, args.pillar_dict)
|
||||||
|
|||||||
Reference in New Issue
Block a user