Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1194418

Summary: API call channel.software.clone does not work as expected for child channels.
Product: [Community] Spacewalk Reporter: Dimitar Yordanov <dyordano>
Component: ServerAssignee: Stephen Herr <sherr>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: high    
Version: 2.2CC: ggainey
Target Milestone: ---Keywords: Patch, Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-java-2.3.143-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-14 19:03:11 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: 1207293    

Description Dimitar Yordanov 2015-02-19 19:02:42 UTC
Description of problem:
API call channel.software.clone does not takes in account the 'parent_label' parameter any longer and always the result channel is a Parent/Base channel instead of Child one.

Version-Release number of selected component (if applicable):
spacewalk-java-2.3.142-1

How reproducible:
Always.

Steps to Reproduce:
1. Create a Parent/Base (ch_parent) and Child channel(ch_child) via WebUI.
    Channels -> Manage Software Channels -> Create channel
2. Clone the Parent/Base channel.
    spacewalk-clone-by-date --assumeyes --channel=ch_parent clone-ch_parent  --username xxxxx --password xxxxx --to_date=2030-01-01
3. Clone the child channel via API using the following script:
  #!/usr/bin/env python
  RHN_SERVER='https://xxxx.redhat.com/rpc/api'
  RHN_USER='xxxxx'    
  RHN_PASS='xxxxx'
  client = xmlrpclib.Server(RHN_SERVER, verbose=0)
  key = client.auth.login(RHN_USER, RHN_PASS)

  details={'parent_label': 'clone-ch_parent', 'summary': 'clone-ch_child', 'name': 'clone-ch_child', 'label': 'clone-ch_child'}
  client.channel.software.clone(key, 'ch_child ', details, True)

Actual results:
clone-ch_child is a Parent/Base channel instead of Child one.

# spacewalk-remove-channel -l
ch_parent
	ch_child
clone-ch_parent
clone-ch_child


Expected results:
clone-ch_child is a Child channel with Parent clone-ch_parent.
# spacewalk-remove-channel -l
ch_parent
	ch_child
clone-ch_parent
	clone-ch_child


Additional info:
The Regression was caused by code refactoring and in particular by

SW commit: 2984025c0b3e0c4f044eafe9f363fe1b2bd3d585
    Port Errata Clone page from perl -> java
    Make nav link to java channel clone and errata clone pages
    Also make various clone errata jsps share common list

Comment 2 Dimitar Yordanov 2015-02-19 19:24:24 UTC
Potential fix in PR: https://github.com/spacewalkproject/spacewalk/pull/224

Comment 3 Grant Gainey 2015-02-19 20:31:43 UTC
Fix looks good!

pushed as spacewalk.github f55909f57b41727074061339c6bf290366da0e32

Comment 4 Grant Gainey 2015-03-23 16:59:05 UTC
Moving bugs to ON_QA as we move to release Spacewalk 2.3

Comment 5 Grant Gainey 2015-04-14 19:03:11 UTC
Spacewalk 2.3 has been released. See

https://fedorahosted.org/spacewalk/wiki/ReleaseNotes23