Bug 595500

Summary: configchannel.createOrUpdatePath cuts off newlines
Product: [Community] Spacewalk Reporter: Josh <joshkayse>
Component: APIAssignee: Lukas Zapletal <lzap>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: low    
Version: 1.0CC: hwinther, jpazdziora, lzap, pruzicka, roysjosh, stanislav.polasek
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
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 14:20:52 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: 620366, 623772, 819027    
Attachments:
Description Flags
api verbose output none

Description Josh 2010-05-24 20:10:18 UTC
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 19:56:21 UTC
Created attachment 416499 [details]
api verbose output

1.0 has the bug still.

Comment 2 Lukas Zapletal 2010-09-16 07:45:47 UTC
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 14:24:42 UTC
f771ac7d4a544a07d853549fa4194fd7020b732a

Comment 4 Lukas Zapletal 2010-09-24 06:20:46 UTC
Setting ON_QA on Cliff's request. This should be already in 2010-09-19 respin.

Comment 5 Jan Pazdziora 2010-11-20 14:20:52 UTC
Aligning under space12 and closing with CURRENTRELEASE.

Comment 6 Tomas Lestach 2012-02-21 16:27:35 UTC
*** Bug 795834 has been marked as a duplicate of this bug. ***

Comment 7 Tomas Lestach 2012-09-26 12:00:27 UTC
*** Bug 856586 has been marked as a duplicate of this bug. ***