Red Hat Bugzilla – Bug 801463
lookupFileInfo and createOrUpdatePath issues for binary files
Last modified: 2012-11-01 12:19:54 EDT
In the latest 1.7 release of spacewalk, lookupFileInfo still returns an empty content for binary files, while getEncodedFileRevision does return the content (base64 encoded I guess). Also createOrUpdatePath has no means to specify that the uploaded file is binary.
So what I suggest:
- either change lookupFileInfo to always return base64 encoded contents, or create a new API call lookupEncodedFileInfo for that
- add the "binary" option createOrUpdatePath, so we can specify that a file is binary
configchannel.lookupFileInfo API was never meant to return binary file content. However I do not see any reason to change this API to return base64 encoded content for binary files, if you may get the binary content using configchannel.getEncodedFileRevision.
You may upload binary files using configchannel.createOrUpdatePath API as base64 encoded. If the decoded content is pure ASCII, it's marked as Text file, otherwise as Binary. Do you see any issues with this behavior?
Please, create one BZ per issue to better track them.
configchannel.lookupFileInfo fails if the config file in question contains xml tags, it seems to be wanting to interpret them when returning the content via the api. Therefore my reason for wanting encoded content. The info returned by configchannel.lookupFileInfo is now wrong for binary files (it claims the file is binary but the content is empty) and failing for some text files (like xml files).
Also: configchannel.getEncodedFileRevision needs a revision, so one needs to call configchannel.lookupFileInfo first on a file to get the revision and then configchannel.getEncodedFileRevision to get the correct content.
And for the uploading: I tested using a tar-file (containing a number of plain text files) and it was marked as a text file in the interface.
Do you wish that I create seperate tickets for this? One for the configchannel.lookupFileInfo failing, one for the configchannel.lookupFileInfo content being empty for binary files, and one for the binary-flag when using configchannel.createOrUpdatePath ?
I fixed several issues for binary config files. Some of them:
configchannel.createOrUpdatePath now accepts also binary attribute
configchannel.createOrUpdatePath - fixed handling of binary files
configchannel.lookupFileInfo now returns base64 encoded content for binary files
I recommend to upload xml config files base64 encoded.
If you see any other issues, please open another BZ. (I tried to address as many as possible within this one.)
Changing the RFE to a bugfix BZ as the upload of binary files via API was broken.
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18