Bug 980523

Summary: it is impossible to modify default org for user with cli
Product: [Retired] Subscription Asset Manager Reporter: Vitaly Kuznetsov <vkuznets>
Component: katelloAssignee: Tom McKay <tomckay>
Status: CLOSED ERRATA QA Contact: Tazim Kolhar <tkolhar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.3CC: cwelton, tkolhar, tomckay
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-01 11:01:10 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:
Bug Depends On:    
Bug Blocks: 833466, 974961    

Description Vitaly Kuznetsov 2013-07-02 15:27:45 UTC
Description of problem:

user has no default org:

[root@ec2-54-216-130-111 ~]# katello --path /sam -u admin -p admin user info --username admin
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                 User Information
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ID                   : 1
Username             : admin
Email                : root@localhost
Disabled             : False
Default Organization : None
Default Environment  : None
Default Locale       : None

Trying to set it up with cli:

[root@ec2-54-216-130-111 ~]# katello --path /sam -u admin -p admin user update --default_organization "Red Hat (Internal Use Only)" --username admin --default_environment "Library"
Successfully updated user [ admin ]

Looks like we succeeded. Checking...

[root@ec2-54-216-130-111 ~]# katello --path /sam -u admin -p admin user info --username admin
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                                 User Information
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

ID                   : 1
Username             : admin
Email                : root@localhost
Disabled             : False
Default Organization : None
Default Environment  : None
Default Locale       : None

Default Organization is still empty.

Version-Release number of selected component (if applicable):
katello-cli-1.4.2-8.el6sat
katello-headpin-1.4.2-17.el6sam_splice

How reproducible:
always

Steps to Reproduce:
1. Try modifying default org with cli

Actual results:
Default org is not modified

Expected results:
Default org is modified

Additional info:

Comment 1 Tom McKay 2013-07-02 15:41:37 UTC
This is likely working as intended behind the scenes since Headpin only has a single valid environment (Library). The options for default env should be hidden both in update and info.

Comment 2 Vitaly Kuznetsov 2013-07-03 09:07:47 UTC
(In reply to Tom McKay from comment #1)
> This is likely working as intended behind the scenes since Headpin only has
> a single valid environment (Library). The options for default env should be
> hidden both in update and info.

I'm interested in default org only. But when I try to set it without setting default env I got the following:

# katello --path /sam -u admin -p admin user update --default_organization "Red Hat (Internal Use Only)" --username admin
Usage:  katello <options> user update <options>

katello: error: Option --default_environment is required; please see --help

Comment 3 Tom McKay 2013-07-03 21:27:37 UTC
Branch: refs/heads/master
  Home:   https://github.com/Katello/katello
  Commit: 4861578f8fc776b8cf0da295fad12f44925459a2
      https://github.com/Katello/katello/commit/4861578f8fc776b8cf0da295fad12f44925459a2
  Author: Tom McKay <thomasmckay>
  Date:   2013-07-03 (Wed, 03 Jul 2013)


Branch: refs/heads/master
  Home:   https://github.com/Katello/katello-cli
  Commit: fb524b44149290adbf159b316a707c7e48383e63
      https://github.com/Katello/katello-cli/commit/fb524b44149290adbf159b316a707c7e48383e63
  Author: Tom McKay <thomasmckay>
  Date:   2013-07-03 (Wed, 03 Jul 2013)

Comment 4 Bryan Kearney 2013-08-02 18:51:39 UTC
SNAP0 contains these bug fixes. Moving to ON_QA.

Comment 5 Tazim Kolhar 2013-08-06 07:55:01 UTC
VERIFIED :

# rpm -qa | grep katello
katello-selinux-1.4.4-2.el6sat.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.4.2-2.el6sat.noarch
katello-common-1.4.3-5.el6sam_splice.noarch
katello-configure-1.4.4-2.el6sat.noarch
katello-cli-common-1.4.3-4.el6sat.noarch
katello-glue-elasticsearch-1.4.3-5.el6sam_splice.noarch
katello-headpin-all-1.4.3-5.el6sam_splice.noarch
katello-cli-1.4.3-4.el6sat.noarch
katello-glue-candlepin-1.4.3-5.el6sam_splice.noarch
signo-katello-0.0.10-2.el6sat.noarch
katello-headpin-1.4.3-5.el6sam_splice.noarch


# headpin --path /sam -u admin -p admin user info --username admin
--------------------------------------------------------------------------------
                                User Information
--------------------------------------------------------------------------------

ID                   : 1
Username             : admin
Email                : root@localhost
Disabled             : False
Default Organization : None
Default Environment  : None
Default Locale       : None

# headpin --path /sam -u admin -p admin user update --default_organization "test" --username admin
Successfully updated user [ admin ]

# headpin --path /sam -u admin -p admin user info --username admin
--------------------------------------------------------------------------------
                                User Information
--------------------------------------------------------------------------------

ID                   : 1
Username             : admin
Email                : root@localhost
Disabled             : False
Default Organization : test
Default Environment  : Library
Default Locale       : None

Comment 7 errata-xmlrpc 2013-10-01 11:01:10 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.

http://rhn.redhat.com/errata/RHEA-2013-1390.html