Bug 795869 - katello-configure ignores --org-name option
Summary: katello-configure ignores --org-name option
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: katello-configure
Version: 1.0.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Jordan OMara
QA Contact: SAM QE List
URL:
Whiteboard:
Depends On:
Blocks: sam11-tracker
TreeView+ depends on / blocked
 
Reported: 2012-02-21 17:14 UTC by Jakub Dorňák
Modified: 2016-12-01 00:56 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The --org-name parameter in katello-configure did not name the default organization correctly. This update fixes the use of --org-name and names the default organization properly.
Clone Of:
Environment:
Last Closed: 2012-06-20 15:20:17 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:1021 0 normal SHIPPED_LIVE Subscription Asset Manager 1.1 bug fix and enhancement update 2012-06-20 15:49:42 UTC

Description Jakub Dorňák 2012-02-21 17:14:14 UTC
Description of problem:
After configuration with command:
katello-configure --deployment=headpin --org-name='Red Hat'
There is only ACME_Corporation available.

Version-Release number of selected component (if applicable):
2012-02-20.1

How reproducible:
on RHEL-6.2 Server GA

Steps to Reproduce:
1. yum -y install katello-headpin-all
2. katello-configure --deployment=headpin --org-name='Red Hat'
3. reboot
4. login to https://<hostname>/headpin as admin/admin
5. check Organizations tab
  
Actual results:
There is one organization named ACME_Corporation.

Expected results:
There should be one organization named 'Red Hat'.

Comment 2 Jordan OMara 2012-02-24 21:48:26 UTC
The bug is in katello-configure; the db seed replacement code does some interesting defensive checking to see if the replacement string exists in what its replacing. Since org_description is built from org_name, if org_description gets replaced first, org_name will decide not to run because the file will already contain the org name.

committed 89324fbcebd3043e541de17c38fa7a760e9e6872

Comment 5 Eric Sammons 2012-04-04 15:31:25 UTC
VERIFIED 

katello-headpin-all-0.1.145-1.el6.noarch

katello-configure --deployment=sam --org-name=RedHat_QE

Comment 6 Jakub Dorňák 2012-04-05 11:08:33 UTC
DOESN'T WORK

katello-headpin-all-0.1.145-1.el6.noarch

katello-configure --deployment=headpin --org-name='Red Hat'

Comment 8 RHEL Program Management 2012-04-05 11:13:43 UTC
Thank you for your bug report. This issue was evaluated for inclusion
in the current release of Subscription Asset Manager (SAM). Unfortunately,
we are unable to address this request. Because we are in the final stages
of development in the current release, only significant, release-blocking
issues involving serious regressions and data corruption can be considered.

If you believe this issue meets the release blocking criteria as defined and
communicated to you by your Red Hat Support representative, please ask
your representative to file this issue as a blocker for the current release.
Otherwise, ask that it be evaluated for inclusion in the next release of SAM.

Comment 9 Tazim Kolhar 2012-04-09 07:57:20 UTC
reviewed the test case

[root@ibm-hs22-03 ~]# katello-configure --deployment=headpin --org-name='Red Hat'
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120409-033042/main.log]
Creating Katello database user
############################################################ ... OK
Creating Katello database
############################################################ ... OK
Creating Candlepin database user
############################################################ ... OK
Creating Candlepin database
############################################################ ... OK
Candlepin setup
############################################################ ... OK
Populating Katello database schema
############################################################ ... OK
Initializing Katello data
############################################################ ... OK

[root@ibm-hs22-03 ~]# reboot

login to https://ibm-hs22-03.rhts.eng.brq.redhat.com/headpin as

admin/admin

checked Organisations tab


[root@ibm-hs22-03 ~]# headpin  -u  admin  -p admin org list
--------------------------------------------------------------------------------
                               Organization List

 Id   Name               Description           
--------------------------------------------------------------------------------
 1    ACME_Corporation   Red Hat Organization  


the --org-name='Red Hat' not shown.

Comment 11 Tazim Kolhar 2012-04-30 09:06:14 UTC
VERIFIED with build :

[root@kvm-guest-05 ~]# hostname
kvm-guest-05.rhts.eng.bos.redhat.com
[root@kvm-guest-05 ~]# rpm -qa | grep katello
katello-configure-0.3.1-2.el6_2.noarch
katello-selinux-0.1.10-1.el6.noarch
katello-cli-headpin-0.2.0-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-configure-upgrade-0.3.1-2.el6_2.noarch
katello-cli-common-0.3.1-1.el6_2.noarch
katello-glue-candlepin-0.3.0-2.el6_2.noarch
katello-certs-tools-1.0.6-1.el6.noarch
katello-headpin-0.2.4-3.el6_2.noarch
katello-common-0.3.0-2.el6_2.noarch
katello-headpin-all-0.2.4-3.el6_2.noarch


[root@kvm-guest-05 ~]# katello-configure --deployment=headpin --org-name='RedHat'
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120430-045953/main.log]
Creating Candlepin database user
############################################################ ... OK
Creating Candlepin database
############################################################ ... OK
Candlepin setup
############################################################ ... OK
Creating Katello database user
############################################################ ... OK
Creating Katello database
############################################################ ... OK
Populating Katello database schema
############################################################ ... OK
Initializing Katello data
############################################################ ... OK
[root@kvm-guest-05 ~]# headpin -u admin -p admin org list
--------------------------------------------------------------------------------
                              Organization List

 Id   Name     Description          
--------------------------------------------------------------------------------
 1    RedHat   RedHat Organization  


The issue has been fixed

Comment 12 Jakub Dorňák 2012-05-06 17:01:04 UTC
Well,
katello-configure doesn't ignore --org option in some cases, but you still ignore my usecase. It doesn't work if the name contains space.

Lets try again.

Comment 13 Jordan OMara 2012-05-10 16:56:29 UTC
Fixed upstream
b7a0d82ffa3e8ed4bd793c8ad3f5894d12ea6836


[root@zapp ~]# katello-configure --org-name='Inter Naught' --deployment=sam
WARNING: FQDN is not set!
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120510-115023/main.log]
Initializing Katello data
############################################################ ... OK
[root@zapp ~]# headpin -u admin -p admin org list
-------------------------------------------------------------------------------------------------------------------------------------------
                                                            Organization List

 Id   Name           Description
-------------------------------------------------------------------------------------------------------------------------------------------
 1    Inter Naught   Inter Naught Organization

Comment 14 Tazim Kolhar 2012-05-21 10:44:48 UTC
VERFIIED with the build :

[root@dhcp201-197 ~]# rpm -qa | grep katello
katello-glue-candlepin-0.3.1-1.el6_2.noarch
katello-cli-headpin-0.2.2-1.el6_2.noarch
katello-headpin-0.2.9-1.el6_2.noarch
katello-configure-0.3.5-1.el6_2.noarch
katello-cli-common-0.3.4-1.el6_2.noarch
katello-common-0.3.1-1.el6_2.noarch
katello-headpin-all-0.2.9-1.el6_2.noarch
katello-certs-tools-1.1.5-1.el6_2.noarch
katello-selinux-0.2.4-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch

[root@dhcp201-197 ~]# katello-configure --deployment=sam --org-name='Red Hat'
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120521-160932/main.log]
Creating Katello database user
############################################################ ... OK
Creating Katello database
############################################################ ... OK
Creating Candlepin database user
############################################################ ... OK
Candlepin setup
############################################################ ... OK
Populating Katello database schema
############################################################ ... OK
Initializing Katello data
############################################################ ... OK


[root@dhcp201-197 ~]# headpin -u admin -p admin org list
--------------------------------------------------------------------------------
                              Organization List

 Id   Name               Description                    
--------------------------------------------------------------------------------
 1    ACME_Corporation   ACME_Corporation Organization

Comment 16 Tazim Kolhar 2012-06-07 10:06:24 UTC
VERIFIED with the build:
[root@dell-pesc1425-01 ~]# rpm -qa | grep katello
katello-cli-common-0.3.5-2.el6_2.noarch
katello-selinux-0.2.4-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-glue-candlepin-0.3.2-1.el6_2.noarch
katello-certs-tools-1.1.5-1.el6_2.noarch
katello-configure-0.3.7-1.el6_2.noarch
katello-headpin-all-0.2.12-2.el6_2.noarch
katello-cli-headpin-0.2.2-1.el6_2.noarch
katello-common-0.3.2-1.el6_2.noarch
katello-headpin-0.2.12-2.el6_2.noarch

[root@dell-pesc1425-01 ~]# katello-configure --deployment=sam --org-name='The Lannisters'
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120607-055204/main.log]
Creating Katello database user
############################################################ ... OK
Creating Katello database
############################################################ ... OK
Creating Candlepin database user
############################################################ ... OK
Candlepin setup
############################################################ ... OK
Populating Katello database schema
############################################################ ... OK
Initializing Katello data
############################################################ ... OK

[root@dell-pesc1425-01 ~]# headpin -u admin -p admin org list
--------------------------------------------------------------------------------
                              Organization List

 Id   Name             Description                  
--------------------------------------------------------------------------------
 1    The Lannisters   The Lannisters Organization

Comment 17 sachua 2012-06-14 03:33:03 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
After configuration with command: 
katello-configure --deployment=sam --org-name='Red Hat'
the organization "Red Hat" is not created and does not appear in the "Organizations" listing. This update now allows users to create organizations using the command: 
katello-configure --deployment=sam --org-name='Red Hat'

Comment 18 Dan Macpherson 2012-06-15 05:09:23 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,4 +1 @@
-After configuration with command: 
+The --org-name parameter in katello-configure did not name the default organization correctly. This update fixes the use of --org-name and names the default organization properly.-katello-configure --deployment=sam --org-name='Red Hat'
-the organization "Red Hat" is not created and does not appear in the "Organizations" listing. This update now allows users to create organizations using the command: 
-katello-configure --deployment=sam --org-name='Red Hat'

Comment 19 Jakub Dorňák 2012-06-15 17:53:47 UTC
This is realy not fun. It already happend that one option worked different way depending on value or presence of other option (https://bugzilla.redhat.com/show_bug.cgi?id=789344). Now it seems that --org-name works depending on presence of --user-name and --user-pass. (Do You see any other difference?)
Please let someone review the code and solve this seriously.

[root@ibm-hs21-11 ~]# rpm -qa | grep katello
katello-selinux-0.2.4-1.el6_2.noarch
katello-cli-common-0.3.5-2.el6_2.noarch
katello-common-0.3.3-1.el6_2.noarch
katello-configure-0.3.7-1.el6_2.noarch
katello-headpin-0.2.13-1.el6_2.noarch
katello-certs-tools-1.1.5-1.el6_2.noarch
katello-cli-headpin-0.2.2-1.el6_2.noarch
katello-glue-candlepin-0.3.3-1.el6_2.noarch
katello-headpin-all-0.2.13-1.el6_2.noarch
[root@ibm-hs21-11 ~]# 

[root@ibm-hs21-11 ~]# katello-configure --deployment=sam --org-name='Red Hat' --user-name=root --user-pass=toor
Starting Katello configuration
The top-level log file is [/var/log/katello/katello-configure-20120615-122432/main.log]
Creating Katello database user
############################################################ ... OK
Creating Katello database
############################################################ ... OK
Creating Candlepin database user
############################################################ ... OK
Candlepin setup
############################################################ ... OK
Populating Katello database schema
############################################################ ... OK
Initializing Katello data
############################################################ ... OK
[root@ibm-hs21-11 ~]# 

[root@ibm-hs21-11 ~]# headpin -u root -p toor org list
--------------------------------------------------------------------------------
                              Organization List

 Id   Name               Description                    
--------------------------------------------------------------------------------
 1    ACME_Corporation   ACME_Corporation Organization  
[root@ibm-hs21-11 ~]#

Comment 21 errata-xmlrpc 2012-06-20 15:20:17 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/RHBA-2012-1021.html


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