Bug 645842 - API call configchannel.lookupFileInfo() does not return 'macro-start-delimiter' and 'macro-end-delimiter'
API call configchannel.lookupFileInfo() does not return 'macro-start-delimite...
Status: CLOSED ERRATA
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
540
Unspecified Unspecified
medium Severity high
: ---
: ---
Assigned To: Tomas Lestach
Pavel Novotny
: Regression
: 663006 (view as bug list)
Depends On:
Blocks: sat54-errata
  Show dependency treegraph
 
Reported: 2010-10-22 11:54 EDT by Pavel Novotny
Modified: 2011-11-10 04:15 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-12-16 10:45:38 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)

  None (edit)
Description Pavel Novotny 2010-10-22 11:54:32 EDT
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.
Comment 1 Pavel Novotny 2010-11-04 07:30:16 EDT
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'}]
-----------------------
Comment 2 Tomas Lestach 2010-11-04 08:30:48 EDT
Fixed.

spacewalk.git: 4dcc5328985794df95c494ce4dc72577946f2c0d
Comment 5 Pavel Novotny 2010-12-06 12:34:56 EST
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'}]
Comment 7 errata-xmlrpc 2010-12-16 10:45:38 EST
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
Comment 8 Jaromir Hradilek 2010-12-16 11:34:21 EST
    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.
Comment 9 Clifford Perry 2011-01-04 12:21:18 EST
*** Bug 663006 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.