Commit Graph

14 Commits

Author SHA1 Message Date
Ed Bartosh c8aad908c8 send-error-report: encode data to bytes
Encoded data before sending it through http as urllib expecting bytes.
Fixed TypeError: POST data should be bytes or an iterable of bytes. It
cannot be of type str.

(From OE-Core rev: b3f4de76d1b32c5079b0b857655cc2baad088519)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:13:30 +01:00
Ed Bartosh cdff6bc0c1 scripts: python3: change python to python3 in shebang
(From OE-Core rev: 4b544ff388497cac82b0585f237900595523e1cb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:13:29 +01:00
Ed Bartosh 793b83a3c6 scripts: python3: rename raw_input to input
Renamed raw_input to input as raw_input does not
exist in python 3.

(From OE-Core rev: 32765150b860ecdea74b4494b9531f5bc40252bb)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:13:29 +01:00
Ed Bartosh f6f10858e5 scripts: python3: fix urllib imports
Some functions and classes have been moved from urllib[2]
to urllib.request and urllib.error in python 3.

Used new imports to make the code working in python 3.

(From OE-Core rev: ec3f1759e8b491a44a1fc1ecb6f89919dd30da97)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03 13:13:29 +01:00
Ed Bartosh 2e388048b6 scripts: python3: Use print function
Used print function instead of print statement to make
the code work in python 3.

(From OE-Core rev: 80fecc44761fa38ccf2e4dc6897b9f1f0c9c1ed0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:47:10 +01:00
Paul Eggleton 8e0a84c901 scripts: print usage in argparse-using scripts when a command-line error occurs
For scripts that use Python's standard argparse module to parse
command-line arguments, create a subclass which will show the usage
the usage information when a command-line parsing error occurs. The most
common case would be when the script is run with no arguments; at least
then the user immediately gets to see what arguments they might need to
pass instead of just an error message.

(From OE-Core rev: d62fe7c9bc2df6a4464440a3cae0539074bf99aa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-28 09:25:12 +00:00
Michael Wood a8b1dede04 scripts/send-error-report: Rework script to support new features
- Add arguments to allow for non-prompted sending, json encoded response
  and link backs.
- Add feature to check the server's max_log_size
- Add feature to allow reviewing of the final data
- Be a bit more helpful if the expected fields aren't filled in instead
  of exiting.
- Remove the redundant urlencode
- Add a user-agent so that the server can identify the encoding method.
- Remove custom proxy handling - urllib should 'just work'

[YOCTO #6736]
[YOCTO #7245]
[YOCTO #7105]

(From OE-Core rev: 5e036f3fd9caaedcd2759214766b3228299e929b)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-10 10:47:38 +00:00
Richard Purdie e2cffc00e1 scripts/send-error-report: Set exit code if error occurs
If an error occurs, set an error exit code so the world knows about it. This fixes
issues where the autobuilder doesn't notice these failures.

[YOCTO #7265]

(From OE-Core rev: b219377defc9517af360986352bd7da1a7906f10)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-01-29 15:36:52 +00:00
Roxana Ciobanu 6a77a1dd22 scripts/send-error-report: fetch /Errors/ instead of /.
If HTTP_PROXY or http_proxy is set when the send-error-report script
is run, it will check to see if fetching / on the specified server
returns 200 without the proxy set. If it does it will assume that the
proxy is not needed. However this check can never work because
fetching / always redirects to /Errors/ in the current code and
thus returns code 301. This is fixed by fetching /Errors/ instead of /.

[YOCTO #YB6576]

(From OE-Core rev: af93c89febcd186d7e31f1d15affc15f38e3379d)

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-06 10:23:39 +01:00
Saul Wold b882c0f995 report-error: Add posting in the public note
(From OE-Core rev: c2eb5cd1aa4632f7ee8c261414e599dcb6f40a8b)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-24 17:55:15 +01:00
Stefan Stanacar e2661d7367 scripts/send-error-report: simple hack to use proxy from the enviroment
People behind a proxy couldn't send an error report to an upstream server,
this should fix the issue if they use a proxy that doesn't require authentication,
or one that uses basic http authentication and it's correctly exported in the enviroment.

(From OE-Core rev: a8511ee80246b4e2caa353b87f4b586f1539e6d4)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-23 11:43:27 +01:00
Stefan Stanacar 0c4d56c86f scripts/send-error-report: use a real server as the default
Now that there is a public instance [1] of the error report web interface [2],
we should set it as the default.

[1] http://errors.yoctoproject.org/
[2] http://git.yoctoproject.org/cgit/cgit.cgi/error-report-web/

(From OE-Core rev: 90a955761db4724f0222527a129a3904d6d8aa6e)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-19 11:04:40 +01:00
Martin Jansa d2c395a618 send-error-report: show response
* useful when debuging why it was refused by server

(From OE-Core rev: 0b8ff2231a36755a71d8bf8c7854364d69ef2df8)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-04 11:53:51 +01:00
Andreea Proca da0a4c7f8d report-error.bbclass: new class to save build information when errors occur
Class is used to save data about errors after every task that failed.
Errors saved as json files in ERROR_REPORT_DIR (defaults to tmp/log/error-report).
To use this class one has to add INHERIT += "report-error" to local.conf.

scripts/send-error-report is a simple script that sends the json file
to a HTTP server that collects data (git://git.yoctoproject.org/error-report-web
is a Django web interface that can be used to receive and visualize
the error reports). The script will give you an URL where you can
find your report.

(From OE-Core rev: f186b4c7c6c975638e60b30a512d669dc6dc390f)

Signed-off-by: Andreea Proca <andreea.b.proca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-14 12:30:20 +00:00