Bug 1074832

Summary: Show friendlier error message if Kerberos credential cache does not exist
Product: [Retired] Beaker Reporter: xjia <xjia>
Component: command lineAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 0.15CC: aigao, asaha, dcallagh, rmancy, tools-bugs, xtian
Target Milestone: 0.16.1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-26 23:54:20 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 xjia 2014-03-11 05:08:37 UTC
Description of problem:
If user doesn't run kinit, "bkr whoami" will prompt traceback. we could show more friendly information.

Version-Release number of selected component (if applicable):
beaker-client-0.15.6-0.git.149.c3925c4.el6eng.noarch

How reproducible:
100%

Steps to Reproduce:
1.kdestroy
2.bkr whoami
3.

Actual results:
[root@dhcp-65-142 ~]# bkr whoami
Traceback (most recent call last):
  File "/usr/bin/bkr", line 9, in <module>
    load_entry_point('bkr.client==0.15.6.git.149.c3925c4', 'console_scripts', 'bkr')()
  File "/usr/lib/python2.6/site-packages/bkr/client/main.py", line 61, in main
    return cmd.run(*cmd_args, **cmd_opts.__dict__)
  File "/usr/lib/python2.6/site-packages/bkr/client/commands/cmd_whoami.py", line 56, in run
    self.set_hub(**kwargs)
  File "/usr/lib/python2.6/site-packages/bkr/client/__init__.py", line 41, in set_hub
    self.container.set_hub(username, password, auto_login=self.requires_login)
  File "/usr/lib/python2.6/site-packages/bkr/client/command.py", line 277, in set_hub
    self.hub = HubProxy(conf=self.conf, auto_login=auto_login)
  File "/usr/lib/python2.6/site-packages/bkr/common/hub.py", line 62, in __init__
    self._login()
  File "/usr/lib/python2.6/site-packages/bkr/common/hub.py", line 101, in _login
    login_method()
  File "/usr/lib/python2.6/site-packages/bkr/common/hub.py", line 174, in _login_krbv
    cprinc = ccache.principal()
krbV.Krb5Error: (-1765328189, 'No credentials cache found')

Expected results:
like: run kinit to create a new ticket

Additional info:

Comment 2 Dan Callaghan 2014-03-11 05:54:17 UTC
On Gerrit: http://gerrit.beaker-project.org/2904

Comment 4 xjia 2014-03-20 01:14:21 UTC
Verify:
[root@dhcp-65-142 ~]# kinit xjia
Password for xjia: 
[root@dhcp-65-142 ~]# bkr whoami
{'username': 'xjia', 'email_address': 'xjia'}
[root@dhcp-65-142 ~]# kdestroy 
[root@dhcp-65-142 ~]# bkr whoami
No Kerberos credential cache found (run kinit to create one)


Version:
beaker-0.16.1-0.git.9.2cea443.el6eng.noarch.rpm
beaker-client-0.16.1-0.git.9.2cea443.el6eng.noarch.rpm

Comment 5 Dan Callaghan 2014-03-26 23:54:20 UTC
Beaker 0.16.1 has been released.