Error behavior in "print" command does not work well in a pipeline
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
parted (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I've got a script that includes "parted <device> print" in a pipeline with other things processing the output. This works fine usually, but I just saw the error
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
and processing appeared to freeze because the following "OK/Cancel" does not include a newline and the pipeline held it in a buffer so it never appeared on the console. There would be no way to answer anyway.
So consider this two or three feature requests:
- Since the message says "that one will be used" make to program just do that (it's just a "print" after all.)
- Provide an option to assume "yes" for such questions (or to assume cancel")
- Provide a command to fix the broken table with data from the good one
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: parted 3.3-4
ProcVersionSign
Uname: Linux 5.4.0-48-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.9
Architecture: amd64
CasperMD5CheckR
Date: Sun Oct 18 11:16:37 2020
InstallationDate: Installed on 2020-09-19 (29 days ago)
InstallationMedia: Xubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
SourcePackage: parted
UpgradeStatus: No upgrade log present (probably fresh install)
I haven't checked it will help in your situation, but parted has a --script command line flag which is documented as "never prompts for user intervention" -- are you using that?