Bug 790550

Summary: katello shell 'changeset' command doesn't use environment from $HOME/.katello/client-options.conf
Product: Red Hat Satellite Reporter: James Laska <jlaska>
Component: katello-agentAssignee: Tomas Strachota <tstrachota>
Status: CLOSED CURRENTRELEASE QA Contact: Garik Khachikyan <gkhachik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: gkhachik, jturner, mkoci, tstrachota
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 18:27:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
0001-790550-katello-shell-Honor-saved_options-environment.patch
none
0001-783405-remembered-options-are-now-recognized-by-opti.patch none

Description James Laska 2012-02-14 20:08:24 UTC
Description of problem:

The katello shell changeset command doesn't recognize client remembered options.  For example, despite having a remember --environment option, the changeset command keeps reprompting for the option.

Version-Release number of selected component (if applicable):
 * katello-cli-0.1.54-3.el6.noarch
 * katello-0.1.235-2.el6.noarch

Steps to Reproduce:
1. # katello -u admin -p admin shell
2. katello> client remember --option org --value redhat
3. katello> client remember --option environment --value Stage
4. katello> changeset list
  
Actual results:

Usage: katello [options]

> katello> changeset list
> katello: error: Option --environment is required; please see --help

Expected results:

> katello> changeset list
> ---------------------------------------------------------------------------------------------------------
>                                              Changeset List
> 
>  Id   Name                Updated At            State      Environment Id   Environment Name  
> ---------------------------------------------------------------------------------------------------------
>  1    01 - cf repos       2012/02/14 09:18:11   promoted   3                Stage             
>  2    02 - rht repos      2012/02/14 09:24:19   promoted   3                Stage             
>  6    03 - templates      2012/02/14 13:46:03   failed     3                Stage             
>  8    04 - configserver   2012/02/14 14:56:11   review     3                Stage             

Additional info:

Comment 1 James Laska 2012-02-15 18:20:24 UTC
Created attachment 562290 [details]
0001-790550-katello-shell-Honor-saved_options-environment.patch

Looks like the problem is because the changeset command stores the parser value as 'env' ... not 'environment'.

How would the user know that the proper --option name is 'env' not 'environment'?

Rather than document that the saved_option --option 'env' is what you use for any command that needs --environment, I'd propose the attached patch instead.

Thoughts?

Comment 2 James Laska 2012-02-16 15:09:02 UTC
For thoughts on the approach+patch in comment#1, adding katello shell expert tstracho to the cc-list.

Comment 3 Tomas Strachota 2012-02-20 14:43:56 UTC
Created attachment 564445 [details]
0001-783405-remembered-options-are-now-recognized-by-opti.patch

Thanks for your patch, James!
I eventually implemented the fix different way. I find it better to keep option names and destinations separate. You can take advantage of having shorter destination names and also more options for one destination.

Comment 4 Tomas Strachota 2012-02-20 14:49:47 UTC
*** Bug 783405 has been marked as a duplicate of this bug. ***

Comment 7 Garik Khachikyan 2012-02-22 15:08:32 UTC
# VERIFIED

Client remember options getting stored under:
.katello/client-options.conf

and the scenario with having changeset list with remembered org & env is going ok now.

verified on versions of Katello:
---
katello-0.1.243-1.git.0.a066880.el6.noarch
katello-cli-0.1.57-1.git.0.4e2dd9a.el6.noarch
pulp-0.0.266-1.el6.noarch
candlepin-0.5.20-1.el6.noarch
---