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.
[RFE] modify kickstart snippet '/var/lib/rhn/kickstarts/snippets/post_reactiv...
Product: Spacewalk
Classification: Community
Component: Server (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Stephen Herr
Red Hat Satellite QA List
: Patch
Depends On: 891373
Blocks: spacewalk-rfe space21
  Show dependency treegraph
Reported: 2013-07-29 12:49 EDT by Stephen Herr
Modified: 2014-03-04 08:09 EST (History)
5 users (show)

See Also:
Fixed In Version: spacewalk-java-2.1.8-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 891373
Last Closed: 2014-03-04 08:08:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stephen Herr 2013-07-29 12:49:07 EDT
+++ 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

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 12:59:59 EDT
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:

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:

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

Committing to Spacewalk master:
Comment 2 Matej Kollar 2014-01-17 07:15:55 EST
Switching MODIFIED Spacewalk bugs to ON_QA before 2.1 release.
Comment 3 Matej Kollar 2014-03-04 08:08:07 EST
Spacewalk 2.1 has been released.
Comment 4 Matej Kollar 2014-03-04 08:09:01 EST
Spacewalk 2.1 has been released.

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