Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1536205

Summary: last rhcert breaks non interactive mode for rhcert-ci clean
Product: Red Hat Certification Program Reporter: Gonéri Le Bouder <goneri>
Component: redhat-certificationAssignee: Zahid Ajaz <zajaz>
Status: CLOSED NOTABUG QA Contact: rhcert qe <rhcert-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.0CC: brose, gnichols, goneri
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-20 12:26:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gonéri Le Bouder 2018-01-18 21:45:25 UTC
Description of problem:

We run rhcert in non-interactive mode but it raises this error:


openstack-certification : Run certification test suite
Error Output: Traceback (most recent call last): File "/bin/rhcert-ci", line 28, in <module> if not rhcert.do(): File "/usr/lib/python2.7/site-packages/rhcert/client/rhcertci.py", line 202, in do result = self.commands[self.command]() File "/usr/lib/python2.7/site-packages/rhcert/client/harness.py", line 1038, in doClean deleteResult = self.ui.promptConfirm("Are you sure you want to delete all current test results?") File "/usr/lib/python2.7/site-packages/rhcert/testUI.py", line 60, in promptConfirm return self.ui.promptConfirm(message) File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 97, in promptConfirm answer = self.prompt(message) File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 74, in prompt response = raw_input(message) EOFError: EOF when reading a line Standard Output: Are you sure you want to delete all current test results? (yes|no) 

Version-Release number of selected component (if applicable):


redhat-certification-openstack-5.6-20180110.el7.noarch
redhat-certification-backend-5.6-20180110.el7.noarch
python-rhsm-certificates-1.19.10-1.el7_4.x86_64
redhat-certification-5.6-20180110.el7.noarch

Comment 1 Gonéri Le Bouder 2018-01-18 21:48:12 UTC
Better output:

Error Output:

Traceback (most recent call last):
  File "/bin/rhcert-ci", line 28, in <module>
    if not rhcert.do():
  File "/usr/lib/python2.7/site-packages/rhcert/client/rhcertci.py", line 202, in do
    result = self.commands[self.command]()
  File "/usr/lib/python2.7/site-packages/rhcert/client/harness.py", line 1038, in doClean
    deleteResult = self.ui.promptConfirm("Are you sure you want to delete all current test results?")
  File "/usr/lib/python2.7/site-packages/rhcert/testUI.py", line 60, in promptConfirm
    return self.ui.promptConfirm(message)
  File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 97, in promptConfirm
    answer = self.prompt(message)
  File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 74, in prompt
    response = raw_input(message)
EOFError: EOF when reading a line

Standard Output:

Are you sure you want to delete all current test results? (yes|no)

Comment 2 Greg Nichols 2018-01-18 22:01:25 UTC
Are you running rhcert-ci clean [all]?

Comment 3 Gonéri Le Bouder 2018-01-19 14:06:35 UTC
yes. e.g:

[root@instack stack]# rhcert-ci clean all
Are you sure you want to delete all current test results? (yes|no) Traceback (most recent call last):
  File "/bin/rhcert-ci", line 28, in <module>
    if not rhcert.do():
  File "/usr/lib/python2.7/site-packages/rhcert/client/rhcertci.py", line 202, in do
    result = self.commands[self.command]()
  File "/usr/lib/python2.7/site-packages/rhcert/client/harness.py", line 1038, in doClean
    deleteResult = self.ui.promptConfirm("Are you sure you want to delete all current test results?")
  File "/usr/lib/python2.7/site-packages/rhcert/testUI.py", line 60, in promptConfirm
    return self.ui.promptConfirm(message)
  File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 97, in promptConfirm
    answer = self.prompt(message)
  File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 74, in prompt
    response = raw_input(message)
KeyboardInterrupt

Comment 4 Greg Nichols 2018-01-19 15:04:00 UTC
Would a work-around such as:

$ yes | rhcert-ci clean all

help?

In any case, we'll get it fixed in rhcert 5.7 which should ship around Feb 7.

Comment 5 Gonéri Le Bouder 2018-01-19 19:33:12 UTC
Thanks Greg. We just push the work around that you suggest: https://softwarefactory-project.io/r/#/c/10929/

Comment 9 errata-xmlrpc 2018-02-01 09:17:07 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://access.redhat.com/errata/RHBA-2018:0261

Comment 10 Gonéri Le Bouder 2018-07-02 15:17:56 UTC
I've the problem again:

[root@undercloud stack]# rpm -qa|grep certification
redhat-certification-5.14-20180625.2.el7.noarch
redhat-certification-baremetal-5.14-20180625.2.el7.noarch
redhat-certification-backend-5.14-20180625.2.el7.noarch
redhat-certification-openstack-5.14-20180625.2.el7.noarch
[root@undercloud stack]# rhcert-cli clean all
Error: rhcert is already running (lock file /var/lock/subsys/rhcert found)
Override? (yes|no) Traceback (most recent call last):
  File "/bin/rhcert-cli", line 30, in <module>
    success = rhcertCLI.do()
  File "/usr/lib/python2.7/site-packages/rhcert/client/rhcertcli.py", line 260, in do
    if not self.getLock():
  File "/usr/lib/python2.7/site-packages/rhcert/client/harness.py", line 1368, in getLock
    if self.ui.promptConfirm("Override?"):
  File "/usr/lib/python2.7/site-packages/rhcert/testUI.py", line 60, in promptConfirm
    return self.ui.promptConfirm(message)
  File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 97, in promptConfirm
    answer = self.prompt(message)
  File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 74, in prompt
    response = raw_input(message)
KeyboardInterrupt

Comment 11 Gonéri Le Bouder 2018-07-02 15:19:12 UTC
The correct backtrace:

[root@undercloud stack]# rhcert-cli clean all
Are you sure you want to delete all current test results? (yes|no) Traceback (most recent call last):
  File "/bin/rhcert-cli", line 30, in <module>
    success = rhcertCLI.do()
  File "/usr/lib/python2.7/site-packages/rhcert/client/rhcertcli.py", line 286, in do
    result = self.commands[self.command]()
  File "/usr/lib/python2.7/site-packages/rhcert/client/harness.py", line 1074, in doClean
    if bypassPrompt or self.ui.promptConfirm("Are you sure you want to delete all current test results?"):
  File "/usr/lib/python2.7/site-packages/rhcert/testUI.py", line 60, in promptConfirm
    return self.ui.promptConfirm(message)
  File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 97, in promptConfirm
    answer = self.prompt(message)
  File "/usr/lib/python2.7/site-packages/rhcert/commandLineUI.py", line 74, in prompt
    response = raw_input(message)
KeyboardInterrupt

Comment 12 Zahid Ajaz 2018-07-03 06:14:38 UTC
We tried to reproduce the issue you are reportedly facing (using the version you have listed) but it is not reproducible.

$ rpm -qa|grep certification
redhat-certification-5.14-20180625.2.el7.noarch
redhat-certification-openstack-5.14-20180625.2.el7.noarch
redhat-certification-backend-5.14-20180625.2.el7.noarch
redhat-certification-baremetal-5.14-20180625.2.el7.noarch


$ rhcert-cli clean all                                 
Are you sure you want to delete all current test results? (yes|no) y
Also remove certification data? (yes|no) y

$ rhcert-cli clean    
Are you sure you want to delete all current test results? (yes|no) yes


The commands worked correctly.

Please provide additional information on reproducing the issue.

Comment 13 Gonéri Le Bouder 2018-07-03 08:04:42 UTC
The problem is the interactive prompt. We cannot use that in an Ansible playbook and Greg work around does not work anymore because we now have 2 interactions.

Comment 14 Greg Nichols 2018-07-09 11:23:11 UTC
The CI version of the command should work without a prompt for rhcert-5.7 and beyond:

> rhcert-ci clean all

Comment 15 Zahid Ajaz 2018-08-20 12:25:44 UTC
Using ci version of 'clean' and 'clean all' commands worked fine.

$ rhcert-ci clean all                                 


$ rhcert-cl clean