Merge lp:~oem-qa/checkbox/patch_exit_on_whitelist_file_not_found into lp:checkbox
Status: | Merged |
---|---|
Merged at revision: | 951 |
Proposed branch: | lp:~oem-qa/checkbox/patch_exit_on_whitelist_file_not_found |
Merge into: | lp:checkbox |
Diff against target: |
25 lines (+6/-3) 1 file modified
plugins/jobs_info.py (+6/-3) |
To merge this branch: | bzr merge lp:~oem-qa/checkbox/patch_exit_on_whitelist_file_not_found |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Manrique (community) | Approve | ||
Review via email: mp+67810@code.launchpad.net |
Commit message
Print error message and exit on whitelist/blacklist file not found
Description of the change
When a user mistypes the name of the whitelist/blacklist file in the command line:
- checkbox execution isn't stopped even if the file doesn't exist
- just an info line is displayed in logs: "Failed to open file '%s': %s"
- whitelist/blacklist patterns aren't applied (without providing any feedback regarding the reason to the user)
With this change:
- filenames passed through the command line are checked
- if a file doesn't exist an error message is printed to stderr and the application exits
Low level details:
- Logging level for the error messsage set to critical since this problem now causes the whole application to exit abruptly.
- Exit code is set to EX_NOINPUT which is the recommended one for files not found or not readable.
Thanks Javier, this works fine with both the shorthand and extended whitelist/blacklist syntax, I just added a gettext.gettext call to the error string.