Bug 989630 - [RFE] modify kickstart snippet '/var/lib/rhn/kickstarts/snippets/post_reactivation_key' to open the '/mnt/sysimage/tmp/key' file in 'a' mode instead of 'w' mode.
Summary: [RFE] modify kickstart snippet '/var/lib/rhn/kickstarts/snippets/post_reactiv...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On: 891373
Blocks: spacewalk-rfe space21
TreeView+ depends on / blocked
 
Reported: 2013-07-29 16:49 UTC by Stephen Herr
Modified: 2014-03-04 13:09 UTC (History)
5 users (show)

Fixed In Version: spacewalk-java-2.1.8-1
Doc Type: Bug Fix
Doc Text:
Clone Of: 891373
Environment:
Last Closed: 2014-03-04 13:08:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Stephen Herr 2013-07-29 16:49:07 UTC
+++ This bug was initially created as a clone of Bug #891373 +++

1. Proposed title of this feature request

Request to modify kickstart snippet '/var/lib/rhn/kickstarts/snippets/post_reactivation_key' to open the '/mnt/sysimage/tmp/key' file in 'a' mode instead of 'w' mode.

3. What is the nature and description of the request?

The customer is doing the PXE installation using Satellite. The PXE menu provides user list of activation keys and accordingly saves selected key in file '/mnt/sysimage/tmp/key'. The Satellite's post script snippet '/var/lib/rhn/kickstarts/snippets/post_reactivation_key' opens '/mnt/sysimage/tmp/key' file in 'w' mode which overwrites previously created file in pre script which stores user selected activation key. If we modify file opening mode to append mode('a') then it works as expected,

f = open("/mnt/sysimage/tmp/key","a")

4. Why does the customer need this? (List the business requirements here)

Our installation process has to use activation-keys to define the final configuration of the machine. To reuse an already implemented mechanism to append our user-defined keys to the list of "satellite configured" keys reduces the number of additional steps during activation.

5. How would the customer like to achieve this? (List the functional
requirements here)

By modifying the file '/var/lib/rhn/kickstarts/snippets/post_reactivation_key' of spacewalk-java package to open file "/mnt/sysimage/tmp/key" in append mode.

6. For each functional requirement listed in question 5, specify how Red Hat
and the customer can test to confirm the requirement is successfully
implemented.

Create the file /mnt/sysimage/tmp/key which has some activation keys and then try the kickstart installation to check whether existing activation keys are there in this file.

Comment 1 Stephen Herr 2013-07-29 16:59:59 UTC
Proposed patch rejected. Python automatically writes new data to the new line if the file is opened in append mode, so the resultant file would look like this:
####
<user-defined-key>
<satellite-reactivation-key>
####

When being cat'd out in the rhnreg_ks command the newline character breaks the command syntax. Instead you have to open it in 'r+' mode and seek to the end of the file so you can create a file that looks like:
####
<user-defined-key>,<satellite-reactivation-key>
####

The user key can actually be a list of keys, comma separated, and it will work fine.

Committing to Spacewalk master:
874edc119d880b15878722be68f9afc27bd9e433

Comment 2 Matej Kollar 2014-01-17 12:15:55 UTC
Switching MODIFIED Spacewalk bugs to ON_QA before 2.1 release.

Comment 3 Matej Kollar 2014-03-04 13:08:07 UTC
Spacewalk 2.1 has been released.
https://fedorahosted.org/spacewalk/wiki/ReleaseNotes21

Comment 4 Matej Kollar 2014-03-04 13:09:01 UTC
Spacewalk 2.1 has been released.
https://fedorahosted.org/spacewalk/wiki/ReleaseNotes21


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