Bug 1074832 - Show friendlier error message if Kerberos credential cache does not exist
Summary: Show friendlier error message if Kerberos credential cache does not exist
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.15
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: 0.16.1
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-11 05:08 UTC by xjia
Modified: 2018-02-06 00:41 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-03-26 23:54:20 UTC
Embargoed:


Attachments (Terms of Use)

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.


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