Merge lp:~cprov/snappy-proposed-selftest-agent/rescue into lp:snappy-proposed-selftest-agent

Proposed by Celso Providelo
Status: Merged
Approved by: Celso Providelo
Approved revision: 17
Merged at revision: 16
Proposed branch: lp:~cprov/snappy-proposed-selftest-agent/rescue
Merge into: lp:snappy-proposed-selftest-agent
Diff against target: 52 lines (+12/-1)
1 file modified
snappy_proposed_selftest_agent/worker.py (+12/-1)
To merge this branch: bzr merge lp:~cprov/snappy-proposed-selftest-agent/rescue
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
Review via email: mp+261800@code.launchpad.net

Commit message

Improving logging, specially errors.

Description of the change

Improving logging, specially errors.

Missing keys (source_binaries and distribution) added to lp:~cprov/+junk/snappy-proposed-testing.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) :
review: Approve
Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :
Download full text (8.3 KiB)

The attempt to merge lp:~cprov/snappy-proposed-selftest-agent/rescue into lp:snappy-proposed-selftest-agent failed. Below is the output from the failed tests.

Using base prefix '/usr'
New python executable in /tmp/venv-snappy-proposed-selftest-agentbil21h3f/bin/python3
Also creating executable in /tmp/venv-snappy-proposed-selftest-agentbil21h3f/bin/python
Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/bin/python3
Ignoring indexes: https://pypi.python.org/simple/
Downloading/unpacking kombu==3.0.24 (from -r requirements.txt (line 1))
Downloading/unpacking python-logstash==0.4.2 (from -r requirements.txt (line 2))
  Running setup.py (path:/tmp/venv-snappy-proposed-selftest-agentbil21h3f/build/python-logstash/setup.py) egg_info for package python-logstash

Downloading/unpacking uservice-utils==1.0.2.1 (from -r requirements.txt (line 3))
Downloading/unpacking anyjson>=0.3.3 (from kombu==3.0.24->-r requirements.txt (line 1))
  Running setup.py (path:/tmp/venv-snappy-proposed-selftest-agentbil21h3f/build/anyjson/setup.py) egg_info for package anyjson

Downloading/unpacking amqp>=1.4.5,<2.0 (from kombu==3.0.24->-r requirements.txt (line 1))
  Running setup.py (path:/tmp/venv-snappy-proposed-selftest-agentbil21h3f/build/amqp/setup.py) egg_info for package amqp

Installing collected packages: kombu, python-logstash, uservice-utils, anyjson, amqp
  Running setup.py install for python-logstash

  Running setup.py install for anyjson
    Fixing build/lib/anyjson/__init__.py
    Skipping implicit fixer: buffer
    Skipping implicit fixer: idioms
    Skipping implicit fixer: set_literal
    Skipping implicit fixer: ws_comma
    Fixing build/lib/anyjson/__init__.py
    Skipping implicit fixer: buffer
    Skipping implicit fixer: idioms
    Skipping implicit fixer: set_literal
    Skipping implicit fixer: ws_comma

  Running setup.py install for amqp

Successfully installed kombu python-logstash uservice-utils anyjson amqp
Cleaning up...
Downloading/unpacking flake8==2.4.0 (from -r test_requirements.txt (line 1))
  Downloading flake8-2.4.0-py2.py3-none-any.whl
Downloading/unpacking testtools==1.7.1 (from -r test_requirements.txt (line 2))
Downloading/unpacking mock==1.0.1 (from -r test_requirements.txt (line 3))
  Running setup.py (path:/tmp/venv-snappy-proposed-selftest-agentbil21h3f/build/mock/setup.py) egg_info for package mock

    warning: no files found matching '*.png' under directory 'docs'
    warning: no files found matching '*.css' under directory 'docs'
    warning: no files found matching '*.html' under directory 'docs'
    warning: no files found matching '*.js' under directory 'docs'
Downloading/unpacking pep8>=1.5.7,<1.6 (from flake8==2.4.0->-r test_requirements.txt (line 1))
  Downloading pep8-1.5.7-py2.py3-none-any.whl
Downloading/unpacking mccabe>=0.2.1,<0.4 (from flake8==2.4.0->-r test_requirements.txt (line 1))
  Downloading mccabe-0.3-py2.py3-none-any.whl
Downloading/unpacking pyflakes>=0.8.1,<0.9 (from flake8==2.4.0->-r test_requirements.txt (line 1))
  Downloading pyflakes-0.8.1-py2.py3-none-any.whl
Downloading/unpacking unittest2>=1.0.0 (from testtools==1.7.1->-r test_requirem...

Read more...

17. By Celso Providelo

Fix flake8 issue.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy_proposed_selftest_agent/worker.py'
2--- snappy_proposed_selftest_agent/worker.py 2015-06-04 18:36:00 +0000
3+++ snappy_proposed_selftest_agent/worker.py 2015-06-12 11:17:02 +0000
4@@ -72,10 +72,15 @@
5
6 def process(self, body, message):
7 """ Process incoming messages about candidate packages """
8+ extra = constants.LOGGING_EXTRA.copy()
9+ extra.update(body)
10+ logger.info('Got %r', body, extra=extra)
11 try:
12 series = body['series']
13 source_binaries = body['source_binaries']
14 except KeyError:
15+ logger.error(
16+ 'Unable to unpack payload!', extra=extra, exc_info=True)
17 retry_count = int(body.get('candidates_retry_count', '0'))
18 if retry_count < self.max_retries:
19 body['candidates_retry_count'] = retry_count + 1
20@@ -85,7 +90,7 @@
21 logger.error(
22 "Rejecting message due to retry count exceeding maximum. "
23 "Message will reside on the dead letter queue",
24- )
25+ extra=extra)
26 with self.connection.SimpleQueue(
27 constants.DEAD_LETTER_QUEUE) as q:
28 q.put(body)
29@@ -95,6 +100,7 @@
30 # this agent cares about.
31 context_series = constants.RELEASE_MAP[constants.RELEASE]
32 if context_series != series:
33+ logger.info('Series not considered: %s', series, extra=extra)
34 message.ack()
35 return
36
37@@ -106,6 +112,7 @@
38 )
39
40 if not image_binaries:
41+ logger.info('Binaries not part of the core image.', extra=extra)
42 message.ack()
43 return
44
45@@ -132,3 +139,7 @@
46 self.result_worker(payload)
47
48 message.ack()
49+
50+ extra.update(payload)
51+ logger.info('Image build requested for: %r',
52+ image_binaries, extra=extra)

Subscribers

People subscribed via source and target branches