Bug 2071765 - osc.bash_completion ends with garbage
Summary: osc.bash_completion ends with garbage
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-tripleoclient
Version: 16.2 (Train)
Hardware: x86_64
OS: Unspecified
low
low
Target Milestone: z4
: 16.2 (Train on RHEL 8.4)
Assignee: Rabi Mishra
QA Contact: David Rosenfeld
URL:
Whiteboard:
: 2076667 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-04 18:18 UTC by François Rigault
Modified: 2022-12-07 19:22 UTC (History)
17 users (show)

Fixed In Version: python-tripleoclient-12.6.1-2.20220725105244.8cc1d6d.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-07 19:22:17 UTC
Target Upstream Version:
Embargoed:
frigo: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 838459 0 None MERGED [train-only] Move logging setup to apps main function 2022-04-29 08:37:45 UTC
Red Hat Issue Tracker OSP-14497 0 None None None 2022-04-04 18:21:37 UTC
Red Hat Knowledge Base (Solution) 6957835 0 None None None 2022-05-17 13:05:18 UTC
Red Hat Product Errata RHBA-2022:8794 0 None None None 2022-12-07 19:22:54 UTC

Description François Rigault 2022-04-04 18:18:00 UTC
Description of problem:
upgraded my OSP 16.2 stack
now each time I ssh to the director I get:
-bash: 2022-04-04: command not found

Version-Release number of selected component (if applicable):
python3-openstackclient-4.0.2-2.20220111042153.54bf2c0.el8ost.noarch

How reproducible:
all the time

Steps to Reproduce:
1. sudo dnf reinstall python3-openstackclient4.0.2-2.20220111042153.54bf2c0.el8ost.noarch
2. tail /etc/bash_completion.d/osc.bash_completion
3. see garbage

Actual results:
$ tail /etc/bash_completion.d/osc.bash_completion

  if [ -z "${completed}" ] ; then
    COMPREPLY=( $( compgen -f -- "$cur" ) $( compgen -d -- "$cur" ) )
  else
    COMPREPLY=( $(compgen -W "${completed}" -- ${cur}) )
  fi
  return 0
}
complete -F _openstack openstack
2022-04-04 20:08:04.813 645220 INFO osc_lib.shell [-] END return value: 0


Expected results:
/etc/bash_completion.d/osc.bash_completion should not contain garbage

Additional info:
package spec reads: 

%post -n python%{pyver}-%{sname}
mkdir -p /etc/bash_completion.d
openstack complete | sed -n '/_openstack/,$p' > /etc/bash_completion.d/osc.bash_completion



however I read
$ openstack complete 2>/dev/null | tail

  if [ -z "${completed}" ] ; then
    COMPREPLY=( $( compgen -f -- "$cur" ) $( compgen -d -- "$cur" ) )
  else
    COMPREPLY=( $(compgen -W "${completed}" -- ${cur}) )
  fi
  return 0
}
complete -F _openstack openstack
2022-04-04 20:17:22.149 666022 INFO osc_lib.shell [-] END return value: 0

there is one line there to remove.

Comment 1 Rabi Mishra 2022-04-05 04:58:17 UTC
I don't see that with a fresh installation with same openstackclient version. May be it's left behind for you from before?


[stack@undercloud-0 ~]$ rpm -qa | grep python3-openstackclient
python3-openstackclient-4.0.2-2.20220111042153.54bf2c0.el8ost.noarch
[stack@undercloud-0 ~]$ tail /etc/bash_completion.d/osc.bash_completion
  done

  if [ -z "${completed}" ] ; then
    COMPREPLY=( $( compgen -f -- "$cur" ) $( compgen -d -- "$cur" ) )
  else
    COMPREPLY=( $(compgen -W "${completed}" -- ${cur}) )
  fi
  return 0
}
complete -F _openstack openstack

Comment 2 François Rigault 2022-04-05 15:29:41 UTC
Sorry I missed your comment
hmmm I have different stacks,and they all have this issue (running "openstack complete" always end with an INFO log). Going to check if I can track what is adding the log. Maybe I have "INFO" logs coming from somewhere

Comment 3 François Rigault 2022-04-05 16:28:34 UTC
so it comes from tripleoclient (python3-tripleoclient-12.6.1-2.20220114104841.el8ost.noarch) it seems.
under /usr/lib/python3.6/site-packages/tripleoclient/v1 there are a couple of files setting the logging, like overcloud_external_update.py:

    CONF = cfg.CONF
    logging.register_options(CONF)
    logging.setup(CONF, '')

commenting these 3 lines in files:

 overcloud_update.py
 overcloud_upgrade.py
 overcloud_admin.py
 overcloud_external_update.py
 overcloud_external_upgrade.py
 tripleo_upgrade.py

removes the INFO message.

Could you check if you reproduce after installing python3-tripleoclient? Thanks

Comment 4 François Rigault 2022-04-09 07:47:34 UTC
so this is the sequence that breaks it:

1- install python3-openstackclient
2- install python3-tripleoclient
3- reinstall or update python3-openstackclient

Comment 5 Rabi Mishra 2022-04-19 09:23:26 UTC
OK, I suspect

Comment 6 Rabi Mishra 2022-04-25 13:21:55 UTC
*** Bug 2076667 has been marked as a duplicate of this bug. ***

Comment 21 errata-xmlrpc 2022-12-07 19:22:17 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 (Release of components for Red Hat OpenStack Platform 16.2.4), 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://access.redhat.com/errata/RHBA-2022:8794


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