Hi Marian,
Below is an example of how to upload files in real time in beaker. I am
doing this for the console logging. It should be very similar for the
harness.
Two methods for uploading files
task_upload_file Uploads file to task specific location
(typically the stdout/stderr of the task)
recipe_upload_file Uploads file to recipe specific location
(typically console logs)
server = xmlrpclib.Server("http://%s:%s" % (server_hostname, port))
if os.path.exists(filepath):
file = open(filepath, "r")
while True:
where = file.tell()
line = file.read(65536)
if not line:
time.sleep(1)
file.seek(where)
else:
size = len(line)
data = base64.encodestring(line)
md5sum = md5_constructor(line).hexdigest()
server.task_upload_file(task_id,
"/",
"taskoutput.log",
size,
md5sum,
where,
data)
Should be able to do the above from a pipe as well. May have to change
the seek
Show replies by date