Bug 595500 - configchannel.createOrUpdatePath cuts off newlines
configchannel.createOrUpdatePath cuts off newlines
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: API (Show other bugs)
1.0
All Linux
low Severity medium
: ---
: ---
Assigned To: Lukas Zapletal
Red Hat Satellite QA List
:
: 795834 856586 (view as bug list)
Depends On:
Blocks: 620366 space12 819027
  Show dependency treegraph
 
Reported: 2010-05-24 16:10 EDT by Josh
Modified: 2013-03-07 19:13 EST (History)
6 users (show)

See Also:
Fixed In Version: spacewalk-java-1.2.41-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 620366 (view as bug list)
Environment:
Last Closed: 2010-11-20 09:20:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
api verbose output (4.06 KB, text/plain)
2010-05-25 15:56 EDT, Joshua Roys
no flags Details

  None (edit)
Description Josh 2010-05-24 16:10:18 EDT
Description of problem:
using the createOrUpdatePath xmlrpc command API results in newlines being removed from the end of the file

Version-Release number of selected component (if applicable):
0.6

How reproducible:
Always

Steps to Reproduce:
1. configchannel.createOrUpdatePath()
2. Log in to web ui, see that the file has a missing newline.
3.
  
Actual results:
ending newlines are removed

Expected results:
ending newlines are preserved

Additional info:
have not tested against 1.0 yet
Comment 1 Joshua Roys 2010-05-25 15:56:21 EDT
Created attachment 416499 [details]
api verbose output

1.0 has the bug still.
Comment 2 Lukas Zapletal 2010-09-16 03:45:47 EDT
I am going to commit a fix that will add new parameter named "contents_enc64" to the filestruct of client.system.config.createOrUpdatePath API call. When this parameter is set to true the server expects to have the content in base64 encoding. This prevents from any whitespace stripping that takes place while parsing XML. Example:

# login etc

content = base64.b64encode(open("/my/config/file.conf").read())

file_struct = { 'contents':content,
        'owner':owner,
        'group':group,
        'permissions':permissions,
        'macro-start-delimiter':'',
        'macro-end-delimiter':'',
        'contents_enc64':'true' }

# call createOrUpdatePath and logout
Comment 3 Lukas Zapletal 2010-09-16 10:24:42 EDT
f771ac7d4a544a07d853549fa4194fd7020b732a
Comment 4 Lukas Zapletal 2010-09-24 02:20:46 EDT
Setting ON_QA on Cliff's request. This should be already in 2010-09-19 respin.
Comment 5 Jan Pazdziora 2010-11-20 09:20:52 EST
Aligning under space12 and closing with CURRENTRELEASE.
Comment 6 Tomas Lestach 2012-02-21 11:27:35 EST
*** Bug 795834 has been marked as a duplicate of this bug. ***
Comment 7 Tomas Lestach 2012-09-26 08:00:27 EDT
*** Bug 856586 has been marked as a duplicate of this bug. ***

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