config "override" silently accept incomplete override options

Bug #2017960 reported by Chi Wai CHAN
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
logrotate-charm
Fix Released
Undecided
Chi Wai CHAN

Bug Description

The config option "override" will silently accept incomplete "override" options.

In charm-logrotated rev 10, the "override" option accept a JSON formatted string to override the logrotate directives for each file in "/etc/logrotate.d/". The JSON formatted string can be

'[ {"path": "/etc/logrotate.d/rotatefile", "rotate": 5, "interval": "weekly"} ]'

. In this example, this will override directives "rotate" and "interval" "for /etc/logrotate.d/rotatefile". However, if not all "path", "rotate", "interval" are provided, the charm will ignore this config option without warning or error. For example, if one provides the following string to "override":

'[ {"path": "/etc/logrotate.d/rotatefile", "interval": "daily"} ]'

It will not override directive "interval" for "/etc/logrotate.d/rotatefile". I am not sure if this is the expected behavior for this option, at least it is not documented in the config option.

Reference line that causes the issue: https://git.launchpad.net/charm-logrotated/tree/src/lib/lib_logrotate.py#n55

Tags: bseng-1143

Related branches

Eric Chen (eric-chen)
tags: added: bseng-1143
Chi Wai CHAN (raychan96)
Changed in charm-logrotated:
assignee: nobody → Chi Wai CHAN (raychan96)
Chi Wai CHAN (raychan96)
Changed in charm-logrotated:
status: New → Fix Committed
Chi Wai CHAN (raychan96)
Changed in charm-logrotated:
milestone: none → 23.07
Chi Wai CHAN (raychan96)
Changed in charm-logrotated:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.