mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-10 03:02:58 +01:00
Fix incorrect writing of so-status.conf
This commit is contained in:
@@ -100,7 +100,7 @@ def write_pillar(pillar: str, content: dict):
|
|||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
|
||||||
|
|
||||||
def mod_so_status(action: str, items: str):
|
def mod_so_status(action: str, items: List):
|
||||||
with open(so_status_conf, 'a+') as conf:
|
with open(so_status_conf, 'a+') as conf:
|
||||||
conf.seek(0)
|
conf.seek(0)
|
||||||
containers = conf.readlines()
|
containers = conf.readlines()
|
||||||
@@ -112,6 +112,8 @@ def mod_so_status(action: str, items: str):
|
|||||||
else:
|
else:
|
||||||
if action == 'remove': pass
|
if action == 'remove': pass
|
||||||
if action == 'add': containers.append(f'so-{item}\n')
|
if action == 'add': containers.append(f'so-{item}\n')
|
||||||
|
|
||||||
|
[containers.remove(c_name) for c_name in containers if c_name == '\n'] # remove extra newlines
|
||||||
|
|
||||||
conf.seek(0)
|
conf.seek(0)
|
||||||
conf.truncate(0)
|
conf.truncate(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user