growpart doesn't work when LANG=cs_CZ.UTF-8
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-utils (Ubuntu) |
Fix Released
|
Undecided
|
Paride Legovini |
Bug Description
Using growpart with locale cs_CZ on RHEL7/RHEL8 encounters the following error,
# growpart /dev/xvda 2 -v -N
unexpected output in sfdisk --version [sfdisk z util-linux 2.23.2]
I found that,
when LANG=cs_CZ.UTF-8, run command "sfdisk --version" would get "sfdisk z util-linux 2.32.1".
It is weird that the char between z and util-linux is not a space char but a char of UTF-8 code 302.
$ set -- sfdisk z util-linux 2.32.1
$ echo $2
z util-linux
$ echo $2 |od -b
0000000 172 302 240 165 164 151 154 055 154 151 156 165 170 012
0000016
$ echo $3
2.32.1
$ echo $4
so the growpart command failed because the $4 is unset in this case.
# expected output: sfdisk from util-linux 2.25.2
{ error "failed to get sfdisk version"; return 1; }
set -- $out
ver=$4
case "$ver" in
*) error "unexpected output in sfdisk --version [$out]"
esac
[Solution]
one simple fix for growpart could be adding LANG=C before the command sfdisk --version, e.g.
Related branches
- Christian Ehrhardt (community): Approve
- Canonical Server: Pending requested
-
Diff: 113 lines (+19/-26)3 files modifiedbin/growpart (+3/-3)
debian/changelog (+14/-0)
test/test-growpart-lvm (+2/-23)
Changed in cloud-utils: | |
status: | Triaged → Fix Committed |
affects: | cloud-utils → cloud-utils (Ubuntu) |
Hi Project Owner, /github. com/canonical/ cloud-utils/ pull/30,
I sent a pull request https:/
could anyone help to review please?
thanks,
Amy