Bug #31463
closedhammer(1) bash completion spews errors over the command line - Failure to expand '~' in the default configuration
Description
Last Minute Discovery: Duplicate of https://projects.theforeman.org/issues/30639, as far as I can tell
As an unprivileged user on CentOS 8.2 and Foreman 2.3.0 on a read-only filesystem, tab completion in hammer(1) has been borked by errors spewing over the command line, as can be seen by typing "hammer <tab>" on the command line:
$ hammer No permissions to create log dir /var/log/hammer. File /var/log/hammer/hammer.log not writeable, won't log anything to the file! environment command is deprecated and will be removed in one of the future versions. Please use puppet-environment command instead. report command is deprecated and will be removed in one of the future versions. Please use config-report command instead. Error: Read-only file system @ dir_s_mkdir - ~
Running "hammer prebuild-bash-completion", does not fix the issue!
After moving back to the user's home directory, this problem disappears BUT creates a '~' directory in that location,
find ${HOME}/~/ /home/sysadmin/~/ /home/sysadmin/~/.cache
Problem is with the 'mkdir' only, as it then seems to be able to create '.cache/hammer_completion.yml', if executed from the user's home directory.
BUT recreating the original conditions by removing ${HOME}/.cache (and ${HOME}/~ and returning to the read-only file system, the problem can be easily reproduced.
Regards,
Peter
PS: Some additional details:
uname -sr Linux 4.18.0-193.28.1.el8_2.x86_64 dnf list installed | grep -i hammer | sed -e 's/ //' rubygem-hammer_cli.noarch 2.3.0-1.el8 @foreman rubygem-hammer_cli_foreman.noarch 2.3.0-1.el8 @foreman rubygem-hammer_cli_foreman_ansible.noarch 0.3.2-1.fm2_1.el8 @foreman-plugins rubygem-hammer_cli_foreman_discovery.noarch 1.0.2-1.fm2_1.el8 @foreman-plugins rubygem-hammer_cli_foreman_remote_execution.noarch 0.2.0-1.fm2_3.el8 @foreman-plugins rubygem-hammer_cli_foreman_tasks.noarch 0.0.15-1.fm2_2.el8 @foreman-plugins
Updated by Oleh Fedorenko almost 4 years ago
- Is duplicate of Bug #30639: hammer prebuild-bash-completion create a directories '~' and '~/.cache' in user's home directory AND stores JSON in a .yml file added
Updated by Oleh Fedorenko almost 4 years ago
- Status changed from New to Duplicate
- Triaged changed from No to Yes