Bug 799036

Summary: Promoting template with repo that is not already in target environment fails
Product: Red Hat Satellite Reporter: Ivan Necas <inecas>
Component: Content ManagementAssignee: Katello Bug Bin <katello-bugs>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bkearney, gkhachik, jomara, jrist, mbacovsk, mmccune, sghai
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-05-15 18:55:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Script for reproducing the error
none
Stack trace of the error none

Description Ivan Necas 2012-03-01 16:09:30 UTC
Created attachment 566876 [details]
Script for reproducing the error

Version-Release number of selected component (if applicable):
katello-0.1.300-1

How reproducible:
Always

Steps to Reproduce (see also attached script):
1. create org, env, product, repo
2. promote product to the env
3. create another repo for the product
4. create template
5. add newly created repo to the template
6. promote template to the env
  
Actual results:
[ERROR: 2012-03-01 16:44:36 #11526] wrong number of arguments (1 for 2)
the whole stack trace in attachment
Expected results:
Successful promotion

Comment 1 Ivan Necas 2012-03-01 16:10:09 UTC
Created attachment 566877 [details]
Stack trace of the error

Comment 2 Martin Bacovsky 2012-03-07 12:30:29 UTC
This issue was fixed in commit ccf50f and should be included in katello>=0.2.9

Comment 6 Sachin Ghai 2012-03-19 09:44:03 UTC
verified with following CFSE build.

[root@perceptor ~]# rpm -qa | grep -ie katello-0 -ie katello-cli
katello-0.1.304-1.el6.noarch
katello-cli-common-0.1.105-1.el6.noarch
katello-cli-0.1.105-1.el6.noarch


Now I can successfully promote the system template including the repo which is not in the target env.

[root@perceptor ~]# katello -u admin -p admin shell
katello> org create --name sghai
Successfully created org [ sghai ]
katello> environment create --name test --org sghai --prior Library
Successfully created environment [ test ]
katello> provider create --name custom --org sghai
Successfully created provider [ custom ]
katello> product create --name pulp --provider custom --org sghai
Successfully created product [ pulp ]

Created a repo and promoted to next env:
==========================================
katello> repo create --name pulp_64 --product pulp --org sghai --url http://repos.fedorapeople.org/repos/pulp/pulp/v1/stable/6Server/x86_64/
Successfully created repository [ pulp_64 ]
katello> changeset create --name pulp1 --org sghai --env test 
Successfully created changeset [ pulp1 ] for environment [ test ]
katello> changeset update --name pulp1 --org sghai --env test --add_product pulp
Successfully updated changeset [ pulp1 ]
katello> changeset promote --name pulp1 --org sghai --env test
Changeset [ pulp1 ] promoted               

Created another repo which is not in next target env:
====================================================

katello> repo create --name pulp_86 --product pulp --org sghai --url http://repos.fedorapeople.org/repos/pulp/pulp/v1/stable/6Server/i386/
Successfully created repository [ pulp_86 ]

Created  template:
================
katello> template create --name temp1 --org sghai
Successfully created template [ temp1 ]
katello> template update --name temp1 --org sghai --from_product pulp --add_repository pulp_86
Successfully updated template [ temp1 ] 

Promoted template to next env:
============================= 
katello> changeset create --name pulp2 --org sghai --env test
Successfully created changeset [ pulp2 ] for environment [ test ]
katello> changeset update --name pulp2 --org sghai --env test --add_template temp1
Successfully updated changeset [ pulp2 ]
katello> changeset promote --name pulp2 --org sghai --env test
Changeset [ pulp2 ] promoted               
katello>

Comment 7 errata-xmlrpc 2012-05-15 18:55:52 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-2012-0665.html