Bug 620366
Summary: | configchannel.createOrUpdatePath cuts off newlines | ||
---|---|---|---|
Product: | Red Hat Satellite 5 | Reporter: | Vishal Gaikwad <vgaikwad> |
Component: | API | Assignee: | Lukas Zapletal <lzap> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Michael Mráka <mmraka> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 530 | CC: | cperry, jhutar, joshkayse, lzap, marcus.moeller, mmraka, pnovotny, roysjosh, stanislav.polasek |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | spacewalk-java-1.2.39-5-sat | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | 595500 | Environment: | |
Last Closed: | 2010-10-28 15:00:45 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: | 595500 | ||
Bug Blocks: | 608752 |
Description
Vishal Gaikwad
2010-08-02 10:44:55 UTC
Commited in spacewalk, will cherry pick into sat later today. Fixed in 9c3bbcfc6cac71b6abc1056495882383a5bd2072 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, 'owner':owner, 'group':group, 'permissions':permissions, 'macro-start-delimiter':'', 'macro-end-delimiter':'', 'contents_enc64':'true' } # call createOrUpdatePath and logout Setting ON_QA on Cliff's request. This should be already in 2010-09-19 respin. # cat >/tmp/emptylines <EOF 3rd line EOF # cat >/tmp/test.py <<EOF import xmlrpclib import base64 DEFAULT_USER = "admin" DEFAULT_PASSWORD = "XXXXX" 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, 'owner':'apache', 'group':'apache', 'permissions':'444', 'selinux_ctx': 'unconfined_u:object_r:user_tmp_t:s0', 'macro-start-delimiter':'', 'macro-end-delimiter':'', 'contents_enc64':'true' } print client.configchannel.createOrUpdatePath(key, 'configch', '/etc/blabla', False, file_struct) EOF * 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 Verified. Satellite-5.4.0-RHEL5-re20101001.1 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 https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332 RHEA-2010:0803 - RHN Tools enhancement update https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333 RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334 RHEA-2010:0800 - RHN Satellite Server 5.4.0 https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335 Docs are available: http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html Regards, Clifford *** Bug 533828 has been marked as a duplicate of this bug. *** |