[apycotlib] correct post for sending log archive
authorPaul Tonelli <paul.tonelli@logilab.fr>
Tue, 06 Aug 2013 09:55:53 +0200
changeset 1441 9aef65bee67c
parent 1440 f22afd087a8f
child 1442 b4d88164cf62
[apycotlib] correct post for sending log archive
_apycotlib/writer.py
--- a/_apycotlib/writer.py	Tue Apr 22 15:45:16 2014 +0200
+++ b/_apycotlib/writer.py	Tue Aug 06 09:55:53 2013 +0200
@@ -216,12 +216,12 @@
             try:
                 tarball.add(archivedir)
                 tarball.close()
-                self._cnxh.http_post(self._url, vid='create_subentity',
-                                     __cwetype__='File',
-                                     __cwrel__='reverse_execution_archive',
-                                     data=Binary(open(archivefpath, 'rb').read()),
-                                     data_format=u'application/x-bzip2',
-                                     data_name=unicode(archive))
+                files = {'log': (archive, Binary(open(archivefpath,
+                                 'rb').read()))}
+                self._cnxh.http_post(self.instance_url() + 'file-upload',
+                                     files=files,
+                                     field='execution_archive',
+                                     eid=self.target_eid())
             except:
                 self.error('while archiving execution directory', tb=True)
             finally: