Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1194418 - API call channel.software.clone does not work as expected for child channels.
Summary: API call channel.software.clone does not work as expected for child channels.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space23
TreeView+ depends on / blocked
 
Reported: 2015-02-19 19:02 UTC by Dimitar Yordanov
Modified: 2015-04-14 19:03 UTC (History)
1 user (show)

Fixed In Version: spacewalk-java-2.3.143-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-14 19:03:11 UTC
Embargoed:


Attachments (Terms of Use)

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


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