Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 620366 - configchannel.createOrUpdatePath cuts off newlines
configchannel.createOrUpdatePath cuts off newlines
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Lukas Zapletal
Michael Mráka
: 533828 (view as bug list)
Depends On: 595500
Blocks: sat540-canfix
  Show dependency treegraph
Reported: 2010-08-02 06:44 EDT by Vishal Gaikwad
Modified: 2018-11-14 14:33 EST (History)
9 users (show)

See Also:
Fixed In Version: spacewalk-java-1.2.39-5-sat
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 595500
Last Closed: 2010-10-28 11:00:45 EDT
Type: ---
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 Vishal Gaikwad 2010-08-02 06:44:55 EDT
+++ This bug was initially created as a clone of Bug #595500 +++

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):

How reproducible:

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

Expected results:
ending newlines are preserved

Additional info:
have not tested against 1.0 yet

--- Additional comment from roysjosh@gmail.com on 2010-05-25 15:56:21 EDT ---

Created an attachment (id=416499)
api verbose output

1.0 has the bug still.
Comment 6 Lukas Zapletal 2010-09-16 07:30:33 EDT
Commited in spacewalk, will cherry pick into sat later today.
Comment 7 Lukas Zapletal 2010-09-16 10:20:20 EDT
Fixed in 9c3bbcfc6cac71b6abc1056495882383a5bd2072
Comment 8 Lukas Zapletal 2010-09-16 10:25:30 EDT
Added 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,
        'contents_enc64':'true' }

# call createOrUpdatePath and logout
Comment 9 Lukas Zapletal 2010-09-24 02:20:38 EDT
Setting ON_QA on Cliff's request. This should be already in 2010-09-19 respin.
Comment 10 Michael Mráka 2010-10-08 04:10:42 EDT
# cat >/tmp/emptylines <EOF

3rd line


# cat >/tmp/test.py <<EOF
import xmlrpclib
import base64

DEFAULT_USER = "admin"
DEFAULT_SERVER = "localhost"

server_url = "http://%s/rpc/api" % DEFAULT_SERVER
client   = xmlrpclib.Server(server_url)
key      = client.auth.login(DEFAULT_USER, DEFAULT_PASSWORD)

content = base64.b64encode(open("/tmp/emptylines").read())

file_struct = { 'contents':content,
        'selinux_ctx': 'unconfined_u:object_r:user_tmp_t:s0',
        'contents_enc64':'true' }

print client.configchannel.createOrUpdatePath(key, 'configch', '/etc/blabla', False, file_struct)

* created 'configch' config channel in webUI

# python /tmp/test.py
{'binary': False, 'group': 'apache', 'creation': <DateTime '20101008T04:04:12' at 855d08c>, 'modified': <DateTime '20101008T04:04:12' at 855d10c>, 'permissions_mode': '444', 'selinux_ctx': 'unconfined_u:object_r:user_tmp_t:s0', 'channel': 'configch', 'md5': 'cccab077d3cc88bd55d98933cdaa0c98', 'owner': 'apache', 'path': '/etc/blabla', 'permissions': 444, 'type': 'file', 'contents': '\n\n3rd line\n\n', 'revision': 1}

* https://amd-ma78gm-01.rhts.eng.bos.redhat.com/rhn/configuration/file/FileDetails.do?cfid=1
 file has empty lines at the begining and the end

Comment 13 Clifford Perry 2010-10-28 10:55:40 EDT
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. 

RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade

RHEA-2010:0803 - RHN Tools enhancement update

RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update

RHEA-2010:0800 - RHN Satellite Server 5.4.0

Docs are available:


Comment 14 Tomas Lestach 2012-08-13 12:35:28 EDT
*** Bug 533828 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.