Description of problem: API call configchannel.lookupFileInfo(token, channel, [file]) does not return fields 'macro-start-delimiter' and 'macro-end-delimiter' for text files. According to API documantation it should. Version-Release number of selected component (if applicable): >>> client.api.getVersion() '10.11' # rpm -q spacewalk-backend-xmlrpc spacewalk-backend-xmlrpc-1.2.13-11.el5sat How reproducible: Always Steps to Reproduce: 1. Create configuration channel. 2. Create configuration file with type "Text File" in it. 3. On client side, call API function configchannel.lookupFileInfo(token, channel, [file]) and see the result. Actual results: Fields 'macro-start-delimiter' and 'macro-end-delimiter' are missing. Expected results: Fields 'macro-start-delimiter' and 'macro-end-delimiter' should be returned for text files. Additional info: This bug is regression, Satellite 5.3 with API version '10.8' works ok and API call returns delimiter fields.
This bug also affects API function configchannel.createOrUpdatePath(). If you create new config file via this function, it returns exact data as configchannel.lookupFileInfo(). That means without macro delimiter keys. ----------------------- In [12]: conf = server.configchannel.createOrUpdatePath(key, 'conf-channel-1', '/tmp/config.cfg', False, { "contents": "File content", "owner": "root", "group": "root", "permissions": "644", "macro-start-delimiter": "{|", "macro-end-delimiter": "|}" }) In [13]: conf Out[13]: {'binary': False, 'channel': 'conf-channel-1', 'contents': 'File content', 'creation': <DateTime '20101104T11:36:26' at 2559a28>, 'group': 'root', 'md5': '8bb2564936980e92ceec8a5759ec34a8', 'modified': <DateTime '20101104T11:36:26' at 2559a70>, 'owner': 'root', 'path': '/tmp/config.cfg', 'permissions': 644, 'permissions_mode': '644', 'revision': 1, 'type': 'file'} In [14]: conf_info = server.configchannel.lookupFileInfo(key, 'conf-channel-1', ['/tmp/config.cfg']) In [15]: conf_info Out[15]: [{'binary': False, 'channel': 'conf-channel-1', 'contents': 'File content', 'creation': <DateTime '20101104T11:36:26' at 2559d88>, 'group': 'root', 'md5': '8bb2564936980e92ceec8a5759ec34a8', 'modified': <DateTime '20101104T11:36:27' at 2559dd0>, 'owner': 'root', 'path': '/tmp/config.cfg', 'permissions': 644, 'permissions_mode': '644', 'revision': 1, 'type': 'file'}] -----------------------
Fixed. spacewalk.git: 4dcc5328985794df95c494ce4dc72577946f2c0d
Verified. Macro delimiter keys are returned by API. # rpm -q spacewalk-java spacewalk-java-1.2.39-32.el5sat IPython session: In [1]: import xmlrpclib In [2]: SERVER=<FQDN> In [3]: USER=<username> In [4]: PASS=<password> In [5]: s = xmlrpclib.Server('http://%s/rpc/api' % SERVER) In [6]: key = s.auth.login(USER, PASS) In [7]: file_info_new = s.configchannel.lookupFileInfo(key, 'conf-channel-1', [ '/tmp/config.cfg' ]) In [8]: file_info_new Out[8]: [{'binary': False, 'channel': 'conf-channel-1', 'contents': 'This is file content.', 'creation': <DateTime '20101206T17:32:30' at 18c2320>, 'group': 'root', 'macro-end-delimiter': '|}', 'macro-start-delimiter': '{|', 'md5': '8b7d18162895e9e4eb0e21ed522c14f0', 'modified': <DateTime '20101206T17:32:30' at 18c2368>, 'owner': 'root', 'path': '/tmp/config.cfg', 'permissions': 644, 'permissions_mode': '644', 'revision': 2, 'selinux_ctx': 'root:object_r:unconfined_t', 'type': 'file'}] In [9]: new_conf_file = s.configchannel.createOrUpdatePath(key, 'conf-channel-1', '/tmp/config2.cfg', False, { "contents": "File content", "owner": "root", "group": "root", "permissions": "644", "macro-start-delimiter": "{|", "macro-end-delimiter": "|}" }) In [10]: new_conf_file Out[10]: {'binary': False, 'channel': 'conf-channel-1', 'contents': 'File content', 'creation': <DateTime '20101206T17:39:35' at 18c2488>, 'group': 'root', 'macro-end-delimiter': '|}', 'macro-start-delimiter': '{|', 'md5': '8bb2564936980e92ceec8a5759ec34a8', 'modified': <DateTime '20101206T17:39:35' at 18c24d0>, 'owner': 'root', 'path': '/tmp/config2.cfg', 'permissions': 644, 'permissions_mode': '644', 'revision': 1, 'type': 'file'} In [11]: new_file_info = s.configchannel.lookupFileInfo(key, 'conf-channel-1', [ '/tmp/config2.cfg' ]) In [12]: new_file_info Out[12]: [{'binary': False, 'channel': 'conf-channel-1', 'contents': 'File content', 'creation': <DateTime '20101206T17:39:35' at 18c25f0>, 'group': 'root', 'macro-end-delimiter': '|}', 'macro-start-delimiter': '{|', 'md5': '8bb2564936980e92ceec8a5759ec34a8', 'modified': <DateTime '20101206T17:39:35' at 18c2638>, 'owner': 'root', 'path': '/tmp/config2.cfg', 'permissions': 644, 'permissions_mode': '644', 'revision': 1, 'type': 'file'}]
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0991.html
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: For text files, the configchannel.lookupFileInfo() API call has been corrected to return the "macro-start-delimiter" and "macro-end-delimiter" as described in the documentation.
*** Bug 663006 has been marked as a duplicate of this bug. ***