Bug 823798

Summary: lookupFileInfo and createOrUpdatePath issues for binary files
Product: Red Hat Satellite 5 Reporter: Jan Pazdziora <jpazdziora>
Component: APIAssignee: Tomas Lestach <tlestach>
Status: CLOSED CURRENTRELEASE QA Contact: Matej Kollar <mkollar>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 550CC: cperry, jhutar, jpazdziora, liedekef, lpramuk, mkollar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-java-1.7.54-67 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 801463 Environment:
Last Closed: 2012-10-15 13:47:18 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:    
Bug Blocks: 818987, 819024    

Description Jan Pazdziora 2012-05-22 07:47:24 UTC
+++ This bug was initially created as a clone of Bug #801463 +++

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

Comment 1 Jan Pazdziora 2012-05-22 07:47:55 UTC
Tomas Lestach 2012-03-13 11:54:32 CET

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. 

spacewalk.git: b77a05778a707b5fb12b932b78e44d01f3a188de

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.

Comment 4 Matej Kollar 2012-06-19 14:35:50 UTC
Everything works almost like charm, except combination

    ...
>   , "binary": True
>   , "contents_enc64": False
    ...

After discussion with assignee we came to conclusion that this behavior might need some reconsideration (some input checking or at least documentation expansion), so switching back to assigned...

Comment 6 Matej Kollar 2012-06-19 14:42:30 UTC
I forgot to mention that mentioned "except" part of Comment #4 is about configchannel.createOrUpdatePath, expetially "path info" parameter.

Comment 7 Tomas Lestach 2012-06-20 10:34:23 UTC
Updating API documentation ...

spacewalk.git: 93ba1b23f92a1404635cf6dde5293d30f08e18b0

Comment 10 Matej Kollar 2012-06-22 08:36:59 UTC
I verify that functionality for

  configchannel.createOrUpdatePath
  configchannel.lookupFileInfo

works the way that (at least from my point of view) can be understood from documentation. (Also configchannel.lookupFileInfo returns content for binary files, just to explicitly say...).