Bug 1156337

Summary: [RFE] Add clone action to activation keys
Product: Red Hat Satellite 5 Reporter: Tomáš Kašpárek <tkasparek>
Component: WebUIAssignee: Stephen Herr <sherr>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Korbel <mkorbel>
Severity: low Docs Contact:
Priority: unspecified    
Version: 560CC: ajodock, cperry, dyordano, mkorbel, pstudeni, satqe-list, tkasparek, tlestach, xdmoon
Target Milestone: ---Keywords: FutureFeature, Patch
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: spacewalk-java-2.3.8-64 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 796434 Environment:
Last Closed: 2015-01-13 10:19:05 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:
Bug Depends On:    
Bug Blocks: 1128175    

Description Tomáš Kašpárek 2014-10-24 08:59:49 UTC
+++ This bug was initially created as a clone of Bug #796434 +++

Description of problem:
There is currently no automated method to clone an activation key.  An option similar to clone kickstart would help users in creating new keys based off of old ones.

This would help assure the user that the new key was exactly the same as the old key with the exception of any changes made afterwards by the user.

--- Additional comment from Tomas Lestach on 2012-02-23 04:20:42 EST ---

Right, there's no option to clone an activation key.
However a set of API calls from the activationkey namespace can substitute the clone process very well by creating a new activation key and setting it's parameters according the original activation key.

Check 
https://<spacewalk/rhn/apidoc/handlers/ActivationKeyHandler.jsp
for more details.

Comment 2 Martin Korbel 2014-11-07 09:50:58 UTC
TESTED on Satellite-5.7.0-RHEL6-re20141024.0 (spacewalk-java-2.3.8-50.el6sat)

Reproducer:
1. We have got a satellite 5.7 with some package channels, a config channel, a system group.
2. We create a new activation key (AK) with these parameters:
 * Description: Test1
 * Key: 1-xxx
 * Base Channels:  RHEL7 Server
 * Add-On Entitlements: Monitoring, Provisioning 
 * Universal Default: X (check)

 * Child channels RHN-TOOLS
 * Packages: mc
 * Groups: we choose one of our System groups

3. Now, we can try create a new clone of AK. Click on the "clone key" link.
 * Description: Test2
 It works.

4. On the page "List of AK" (/rhn/activationkeys/List.do), we can see both of keys are enabled.

5. Open AK "Test1" and check the option "Configuration File Deployment". Save the change and create new clone "Test 3".

6. Open page "List of AK" (/rhn/activationkeys/List.do), we can see that the latest AK "Test 3" is not enabled.

7. Open AK "Test1" and join a config channel to it. Save the change and create new clone "Test 4". We get a error message " We're sorry, but the configuration channel could not be found.", but a new AK is created.


###  /var/log/tomcat*/catalina.out   ##########################################
2014-11-07 04:23:50,069 [TP-Processor1] WARN  com.redhat.rhn.manager.token.ActivationKeyManager - sorted cids: [105]
2014-11-07 04:23:50,079 [TP-Processor1] WARN  com.redhat.rhn.common.errors.LookupExceptionHandler - Could not find config channel with label=TestChannel


Probably the mistake with the label, because "TestChannel" is not a label, it is a name of the config channel.

Actual results:
Step 6, if we check the option "Configuration File Deployment", then the new cloned activation key is disabled by default.
Step 7, if we try to clone the activation key with some config channel then we get error message.

Expected results:
All new cloned keys are enabled or disabled by default.
No error message here (step7).

Comment 6 Martin Korbel 2014-11-21 12:07:44 UTC
VERIFIED on Satellite-5.7.0-RHEL6-re20141119.0 (spacewalk-java-2.3.8-67.el6sat)


The reproducer in comment 2.

Comment 7 Pavel Studeník 2015-01-13 09:58:47 UTC
Reverified with spacewalk-java-2.3.8-96.el6sat.noarch

The reproducer in comment 2.

Comment 8 Clifford Perry 2015-01-13 10:19:05 UTC
With the release of Red Hat Satellite 5.7 on January 12th 2015 this bug is
being moved to a Closed Current Release state. 

The Satellite 5.7 GA Errata:
 - https://rhn.redhat.com/errata/RHSA-2015-0033.html 

Satellite 5.7 Release Notes:
 -
https://access.redhat.com/documentation/en-US/Red_Hat_Satellite/5.7/html-single/Release_Notes/index.html

Satellite Customer Portal Blog announcement for release:
 - https://access.redhat.com/blogs/1169563/posts/1315743 

Cliff