collect-logs should ignore all tar warnings (return code 1), to avoid skipping the entire tarball

Bug #1625307 reported by Ursula Junque on 2016-09-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Charm
High
Ursula Junque

Bug Description

collect-logs uses tar and subprocess.check_output to create log tarballs. It currently ignores tar return code 1 only if "error" is due files changing during file creation (an acceptable situation for us).

According to tar manual, when failures are fatal, or, result in no tarball, return code is 2. If something happens that's a warning but tarball is created anyway, return code is 1. Only a perfect run is return code 0.

We have been missing tarballs because of the behavior described above, given an exception is raised for everything != 0, that causes collect-logs to skip the tarball entirely. It should be changed to ignore all "errors" with return code 1, outputting the error message but proceeding anyway, given they are mostly warnings.

Related branches

Ursula Junque (ursinha) on 2016-09-19
summary: - collect-logs should ignore all tar errors, to avoid skipping the entire
- tarball
+ collect-logs should ignore all tar warnings (return code 1), to avoid
+ skipping the entire tarball
tags: removed: kanban
Ursula Junque (ursinha) on 2016-09-19
Changed in landscape-charm:
status: Triaged → In Progress
Changed in landscape-charm:
status: In Progress → Fix Committed
Ursula Junque (ursinha) wrote :

This was done when collect-logs script was still part of the landscape-charm project. Now it lives under lp:autopilot-log-analyser, and it's fix released. I'll mark as such.

Changed in landscape-charm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers