Bug 860510 - Bash Completion doesn't complete LVM devices for "lvresize" when "-L" is used
Bash Completion doesn't complete LVM devices for "lvresize" when "-L" is used
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: bash-completion (Show other bugs)
17
All Linux
unspecified Severity low
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-25 22:41 EDT by CJ Kucera
Modified: 2013-04-20 16:06 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-04-17 22:43:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description CJ Kucera 2012-09-25 22:41:47 EDT
Description of problem:

On my F17 box, typing a simple "lvresize /dev/foo<tab>" will let me tab-complete the devices I'd expect to be able to use (namely, /dev/vgname/lvname or /dev/mapper/vgname-lvname).

If I run the command as "lvresize -L +10G /dev/foo<tab>" however, I can't actually tab-complete any of those devices.

Oddly, when I've done it with the arguments, the ONLY device which DOES tab-complete properly in that case is /dev/md126 (which is my main RAID volume).

Not a big deal, but annoying.
Comment 1 Jonathan Nicol 2012-11-12 19:53:06 EST
I'll second this, it doesn't like a space between -L and the argument:

# ls /dev/vg<tab><tab>
vg0/         vg1/         vga_arbiter
(good)

# lvresize <tab><tab>
/dev/vg0/lv_home   /dev/vg0/lv_root   /dev/vg0/lv_swap   /dev/vg1/software  /dev/vg1/virts     
(good)

# lvresize -L40G <tab><tab>
/dev/vg0/lv_home   /dev/vg0/lv_root   /dev/vg0/lv_swap   /dev/vg1/software  /dev/vg1/virts     
(good)

# lvresize -L 40G <tab><tab>
/dev/sda2  /dev/sdb1  
(bad)
Comment 2 Ville Skyttä 2012-11-13 17:00:34 EST
(In reply to comment #1)
> I'll second this, it doesn't like a space between -L and the argument:

Ah, that's the key - thanks for bringing it up. Various lvm completions use quite fragile argument counting which didn't take into account options that are known to take an argument such as -L. Still fragile but the known cases are hopefully now fixed upstream - I don't know/use lvm myself so beware:

http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=e96613e32e21ea389dddba9756bf3d78070acc4b

That diff doesn't apply over vanilla 2.0, but you should be able to grab the whole file/blob and replace /usr/share/bash-completion/completions/lvm with it.
Comment 3 Jonathan Nicol 2012-11-13 19:47:03 EST
works for me, thanks very much :)
Comment 4 Fedora Update System 2013-04-08 16:11:20 EDT
bash-completion-2.1-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/bash-completion-2.1-1.fc18
Comment 5 Fedora Update System 2013-04-08 16:12:35 EDT
bash-completion-2.1-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/bash-completion-2.1-1.fc19
Comment 6 Fedora Update System 2013-04-09 21:39:21 EDT
Package bash-completion-2.1-2.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing bash-completion-2.1-2.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-5298/bash-completion-2.1-2.fc18
then log in and leave karma (feedback).
Comment 7 Fedora Update System 2013-04-17 22:43:36 EDT
bash-completion-2.1-2.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2013-04-20 16:06:18 EDT
bash-completion-2.1-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.