Bug 1151766 - libguestfs-bash-completion package contains file /usr/share/bash-completion/completions/virt-log, but no _virt_log() function in that file
Summary: libguestfs-bash-completion package contains file /usr/share/bash-completion/c...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-11 16:27 UTC by Lingfei Kong
Modified: 2015-03-05 13:46 UTC (History)
5 users (show)

Fixed In Version: libguestfs-1.28.1-1.2.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 13:46:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0303 0 normal SHIPPED_LIVE libguestfs bug fix and enhancement update 2015-03-05 17:34:44 UTC

Description Lingfei Kong 2014-10-11 16:27:44 UTC
Description of problem:
libguestfs-bash-completion package contains file /usr/share/bash-completion/completions/virt-log, but no _virt_log() function in that file. This will forbid shell execute 'complete -F _minimal virt-log' in /usr/share/bash-completion/bash_completion and source file /usr/share/bash-completion/completions/virt-log. Because file /usr/share/bash-completion/completions/virt-log have no _virt_log() function, this will lead to virt-log failed to complete its command line.


Version-Release number of selected component (if applicable):
libguestfs-1.27.62-1.1.el7


How reproducible:
100%


Steps to Reproduce:
1. touch test.img
2. #virt-log -a test<TAB>
3. Search _virt_log in file /usr/share/bash-completion/completions/virt-log
4. 
# set -x
#virt-log -a t<TAB>
+ [[ /usr/share/bash-completion/bash_completion == */* ]]
+ compfile=/usr/share/bash-completion/completions
+ compfile+=/virt-log
+ [[ -f /usr/share/bash-completion/completions/virt-log ]]
+ . /usr/share/bash-completion/completions/virt-log
+ return 124


Actual results:
#virt-log -a test<TAB>
<nothing>

At step 3 can not find completion function for virt-log tool


Expected results:
#virt-edit -a test<TAB>
test.img  

At step 3, there should have completion function for virt-log, such as:
_virt_log ()
{
    _guestfs_virttools "$(virt-log --long-options)" 1
} &&
complete -o default -F _virt_log virt-log


Additional info:

Comment 1 Pino Toscano 2014-10-13 13:10:32 UTC
(In reply to Lingfei Kong from comment #0)
> At step 3, there should have completion function for virt-log, such as:
> _virt_log ()
> {
>     _guestfs_virttools "$(virt-log --long-options)" 1
> } &&
> complete -o default -F _virt_log virt-log

Indeed it was missing, thanks!

Fixed upstream with the commit
https://github.com/libguestfs/libguestfs/commit/94f2eb8b26cef7faa42eba7c9cbe39d6a25858bd

Comment 3 Lingfei Kong 2014-10-22 02:28:55 UTC
Verified with libguestfs-tools-c-1.28.1-1.2.el7

# touch test.img
# virt-log -a te<TAB>
test.img

Comment 5 errata-xmlrpc 2015-03-05 13:46:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0303.html


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