Merge lp:~canonical-platform-qa/snappy-ecosystem-tests/fix-logging-issue into lp:snappy-ecosystem-tests

Proposed by Heber Parrucci
Status: Merged
Approved by: Omer Akram
Approved revision: 49
Merged at revision: 50
Proposed branch: lp:~canonical-platform-qa/snappy-ecosystem-tests/fix-logging-issue
Merge into: lp:snappy-ecosystem-tests
Diff against target: 41 lines (+7/-4)
2 files modified
snappy_ecosystem_tests/environment/managers.py (+7/-0)
snappy_ecosystem_tests/environment/setup.py (+0/-4)
To merge this branch: bzr merge lp:~canonical-platform-qa/snappy-ecosystem-tests/fix-logging-issue
Reviewer Review Type Date Requested Status
Omer Akram (community) Approve
platform-qa-bot continuous-integration Approve
Review via email: mp+321113@code.launchpad.net

Commit message

Fix logging issue

Description of the change

Fix logging issue, right now the logging level is changed globally in snappy_ecosystem_tests/environment/setup.py

So when you run the tests you will see all the debug/info etc. of for example, paramiko in snappy-ecosystem-results.xml.

This MP changes the logging config only for the particular module so you do not get unnecessary information in the snappy-ecosystem-results.xml

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Omer Akram (om26er) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'snappy_ecosystem_tests/environment/managers.py'
2--- snappy_ecosystem_tests/environment/managers.py 2017-03-15 18:09:42 +0000
3+++ snappy_ecosystem_tests/environment/managers.py 2017-03-27 20:24:25 +0000
4@@ -19,6 +19,8 @@
5 #
6 """Managers to setup the environment"""
7
8+import logging
9+
10 from snappy_ecosystem_tests.environment.constants import (
11 PROFILES, DEPENDENCIES)
12 from snappy_ecosystem_tests.environment.containers.lxd import LXDDriver
13@@ -32,6 +34,11 @@
14 }
15 }
16
17+logging.basicConfig()
18+REQUEST_LOGGER = logging.getLogger("requests.packages.urllib3")
19+REQUEST_LOGGER.setLevel(logging.DEBUG)
20+REQUEST_LOGGER.propagate = True
21+
22
23 class _LXDManager:
24 """Manager for lxd containers"""
25
26=== modified file 'snappy_ecosystem_tests/environment/setup.py'
27--- snappy_ecosystem_tests/environment/setup.py 2017-03-15 17:11:23 +0000
28+++ snappy_ecosystem_tests/environment/setup.py 2017-03-27 20:24:25 +0000
29@@ -22,12 +22,8 @@
30
31 import argparse
32
33-import logging
34-
35 from snappy_ecosystem_tests.environment.managers import _LXDManager
36
37-logging.basicConfig(level=logging.DEBUG)
38-
39
40 SUPPORTED_MODULES = {
41 "lxd": _LXDManager

Subscribers

People subscribed via source and target branches