fix(reliability): probe section existence via uci show, not an option key
This commit is contained in:
@@ -34,9 +34,10 @@ def _pool_size():
|
||||
def _ensure_pineapd_section():
|
||||
"""Stock daemon rewrites and profile restores can drop the whole
|
||||
`config pineapd` section; every @pineapd[0] option write fails with
|
||||
'Invalid argument' until it exists again."""
|
||||
rc, out, err = device_run(['uci', '-q', 'get',
|
||||
'pineapd.@pineapd[0].logrecon'])
|
||||
'Invalid argument' until it exists again. Probes SECTION existence
|
||||
(`uci -q show @pineapd[0]`) — never an option, which may legitimately
|
||||
be absent from a rewritten section."""
|
||||
rc, out, err = device_run(['uci', '-q', 'show', 'pineapd.@pineapd[0]'])
|
||||
if rc == 0:
|
||||
return False
|
||||
device_run(['uci', 'add', 'pineapd', 'pineapd'])
|
||||
|
||||
Reference in New Issue
Block a user