Bug 445767

Summary: confichannel.createOrUpdatePath not accepting binary files
Product: Red Hat Satellite 5 Reporter: Partha Aji <paji>
Component: APIAssignee: Partha Aji <paji>
Status: CLOSED CURRENTRELEASE QA Contact: Steve Salevan <ssalevan>
Severity: medium Docs Contact:
Priority: medium    
Version: 510CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat511 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-08-13 19:03:42 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: 429319    

Description Partha Aji 2008-05-08 23:03:55 UTC
Description of problem:
At present, the createOrUpdatePath API method in configchannel namespace does
not accept binary files and throws a ISE. In xmlrpc binary contents can be
represented using base64 encoding, wrapping the contents between <base64>
</base64>. However createOrUpdatePath API method only deals with directories or
text files.

Version-Release number of selected component (if applicable): 510


How reproducible: always


Steps to Reproduce:
1. Create a config channel 'channel-foo'
2. Create/copy a binary file as '/tmp/binary'
3. Run the following script (setup the variables to your configuraiton)
"""
#!/usr/bin/env python
from xmlrpclib import Server, Binary

SATELLITE_HOST = "<your satellite host>"
SATELLITE_URL = "http://%s/rpc/api" % SATELLITE_HOST
SATELLITE_LOGIN = "admin"
SATELLITE_PASSWORD = "password"
client = xmlrpclib.Server(SATELLITE_URL, verbose=1)
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
data = Binary(open("/tmp/binary","rb").read())

client.configchannel.createOrUpdatePath(key,'channel-foo', "/tmp/afoo3",False,
dict( contents = data, owner = "root", group = "root", permissions = "777"))
"""
  
Actual results:

500 ISE - typically a class cast exception in the log.

Expected results:

Proper output showing information pertaining to the create configuration file.
Additional info:

Comment 1 Partha Aji 2008-05-09 21:23:22 UTC
This has been now resolved in both trunk and 5.1.1

http://svn.rhndev.redhat.com/viewcvs?rev=172380&view=rev

Comment 2 Partha Aji 2008-06-09 15:29:11 UTC
Moving to ON_QA

Comment 4 Brandon Perkins 2008-07-01 21:18:55 UTC
Verified.

Comment 6 Brandon Perkins 2008-08-13 19:03:42 UTC
5.1.1 Satellite is now GA, bugs Closed for Current Release.

Comment 7 Brandon Perkins 2008-08-13 19:08:48 UTC
5.1.1 Satellite is now GA, bugs Closed for Current Release.