"netplan apply" accures temporary directories

Bug #1959729 reported by Brian Turek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
netplan
Fix Committed
Undecided
Unassigned

Bug Description

During my testing of "netplan apply", I noticed that 1-2 /tmp/netplan_* directories get created and left per "netplan apply" invocation (one directory always gets created, another if --state is passed in). Similar to #1767464, it appears that nothing is calling the cleanup() method on the created ConfigManager() instances.

Due to how the code is structured, there is no good way of guaranteeing that cleanup() will be called other than wrapping the whole "command_apply" function in netplan/cli/commands/apply.py in a try/finally block which isn't ideal. The other alternative is for ConfigManager to manage itself and maybe add a "rmtree" to its __del__ hook?

I'm happy to do a PR but would like a little guidance as to which method is preferred.

Revision history for this message
Lukas Märdian (slyon) wrote :
Changed in netplan:
status: New → In Progress
Lukas Märdian (slyon)
Changed in netplan:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers