oestats-client.bbclass: fix bug in oestat_send() code
authorYuri Bushmelev <jay4mail@gmail.com>
Sat, 12 Feb 2011 11:00:27 +0000 (14:00 +0300)
committerYuri Bushmelev <jay4mail@gmail.com>
Sat, 12 Feb 2011 11:10:16 +0000 (14:10 +0300)
This should fix disabling oestats with following message:
WARNING: oestats: error sending task (exception <type
'exceptions.KeyError'>, value 'qalog'), disabling stats

Signed-off-by: Yuri Bushmelev <jay4mail@gmail.com>
classes/oestats-client.bbclass

index 9302b29..4233d4a 100644 (file)
@@ -38,7 +38,8 @@ def oestats_send(d, server, action, vars = {}, files = {}):
                output.append('')
                output.append(vars[key])
        for key in files:
-               if not vars[key]: continue
+               if not files[key]: continue
+               if not files[key]['content']: continue
                output.append('--' + bound)
                output.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, files[key]['filename']))
                output.append('Content-Type: %s' % files[key]['content-type'])