Bug 906803

Summary: [Beaker][command-line] watchdog-extend vs. watchdogs-extend
Product: [Retired] Beaker Reporter: Jeff Burke <jburke>
Component: command lineAssignee: Amit Saha <asaha>
Status: CLOSED CURRENTRELEASE QA Contact: Raymond Mancy <rmancy>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.11CC: asaha, bpeck, dcallagh, ebaak, llim, qwan, rglasz, rmancy
Target Milestone: 0.12   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: CommandLineEnhancement
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-11 04:56:48 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 Jeff Burke 2013-02-01 14:23:49 UTC
Description of problem:

I was trying ot extend my task watchdog from the command line with this command:
 $ bkr watchdogs-extend --by=36000 10504220
I kept getting this error:
 XML-RPC fault: <class 'turbogears.identity.exceptions.IdentityFailure'>: Please log in first

Even though I was logged in. I spoke with Bill and he told me I was using an admin only command. I should be using watchdog-extend not watchdogs-extend

$ bkr --help
Usage: bkr <command> [args] [--help]
<snip>
  watchdog-extend                Extend Task's Watchdog
  watchdogs-extend               Extend Task's Watchdog
</snip>

This commands are too similar and the help description is identical, the warning message printed out is not helpful either. 

Would it be possible to combine these command and add admin switch. Or change the name of one of them so it is not so confusing. Also if we do run the admin only command print out that we are not admins.

Thanks,
Jeff

Comment 1 Amit Saha 2013-02-04 02:37:44 UTC
bkr watchdog-extend and bkr watchdogs-extend have distinctly different functions and hence adding a --admin switch to one of them is probably not a good idea. I added some error handling code and also changed the help message to give a better idea.

For example: (here user1 is a non-admin user)

$ bkr watchdogs-extend --user user1 --password user     
This command requires admin priviliges.                                                        │
Were you looking for bkr watchdog-extend instead?


On Gerrit: http://gerrit.beaker-project.org/#/c/1687/

Comment 2 Amit Saha 2013-02-06 09:07:08 UTC
With the patch now merged, the user will get the following error:

Not member of group: admin

if he/she is not so. Thanks for reporting this.

Comment 5 Dan Callaghan 2013-04-11 04:56:48 UTC
Beaker 0.12 has been released.