Merge lp:~joetalbott/adt-cloud-worker/add_log_rotation into lp:adt-cloud-worker

Proposed by Joe Talbott
Status: Merged
Approved by: Joe Talbott
Approved revision: 36
Merged at revision: 34
Proposed branch: lp:~joetalbott/adt-cloud-worker/add_log_rotation
Merge into: lp:adt-cloud-worker
Diff against target: 83 lines (+16/-5)
5 files modified
adt_cloud_worker/__init__.py (+7/-2)
adt_cloud_worker/tests/test_cloud_worker.py (+2/-1)
called-by-tarmac.py (+5/-0)
setup.py (+1/-2)
test_requirements.txt (+1/-0)
To merge this branch: bzr merge lp:~joetalbott/adt-cloud-worker/add_log_rotation
Reviewer Review Type Date Requested Status
Celso Providelo (community) Approve
Review via email: mp+256245@code.launchpad.net

Commit message

Add log rotation and flake8 checking. Fix flake8 issues as well.

Description of the change

Add log rotation and flake8 checking. Fix flake8 issues as well.

To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'adt_cloud_worker/__init__.py'
--- adt_cloud_worker/__init__.py 2015-03-24 01:55:25 +0000
+++ adt_cloud_worker/__init__.py 2015-04-14 22:36:38 +0000
@@ -138,7 +138,8 @@
138138
139139
140def _create_run_metadata_file(directory, request):140def _create_run_metadata_file(directory, request):
141 """Create a metadata file in 'directory' with some of the data from 'request'141 """Create a metadata file in 'directory' with some of the data from
142 'request'.
142143
143 We want to make sure that, as (potentially confidential) items are added to144 We want to make sure that, as (potentially confidential) items are added to
144 the request that we don't blindly add them to the metadata file, so we145 the request that we don't blindly add them to the metadata file, so we
@@ -273,7 +274,11 @@
273 os.path.join(__file__, '../../logs/adt-cloud-worker.log'))274 os.path.join(__file__, '../../logs/adt-cloud-worker.log'))
274 log_dir = os.path.dirname(log_path)275 log_dir = os.path.dirname(log_path)
275 if os.path.exists(log_dir):276 if os.path.exists(log_dir):
276 handler = logging.FileHandler(log_path)277 handler = logging.handlers.TimedRotatingFileHandler(
278 log_path,
279 when='D',
280 interval=1
281 )
277 else:282 else:
278 print("'logs' directory '{}' does not exist, using stderr "283 print("'logs' directory '{}' does not exist, using stderr "
279 "for app log.".format(log_dir))284 "for app log.".format(log_dir))
280285
=== modified file 'adt_cloud_worker/tests/test_cloud_worker.py'
--- adt_cloud_worker/tests/test_cloud_worker.py 2015-03-19 03:08:53 +0000
+++ adt_cloud_worker/tests/test_cloud_worker.py 2015-04-14 22:36:38 +0000
@@ -147,7 +147,8 @@
147class TarballCreationTests(testtools.TestCase):147class TarballCreationTests(testtools.TestCase):
148148
149 def create_tarball_with_cleanup(self, directory_to_tar, tarball_root):149 def create_tarball_with_cleanup(self, directory_to_tar, tarball_root):
150 tarball_path = _create_tarball_from_directory(directory_to_tar, tarball_root)150 tarball_path = _create_tarball_from_directory(directory_to_tar,
151 tarball_root)
151 self.addCleanup(os.remove, tarball_path)152 self.addCleanup(os.remove, tarball_path)
152 return tarball_path153 return tarball_path
153154
154155
=== modified file 'called-by-tarmac.py'
--- called-by-tarmac.py 2015-03-17 15:07:36 +0000
+++ called-by-tarmac.py 2015-04-14 22:36:38 +0000
@@ -89,6 +89,11 @@
89 'setup.py',89 'setup.py',
90 'test',90 'test',
91 ],91 ],
92 [
93 os.path.join(ve_dir, 'bin', 'python3'),
94 'setup.py',
95 'flake8',
96 ],
92 )97 )
93 for cmd in all_cmds:98 for cmd in all_cmds:
94 ret = _run_command(cmd)99 ret = _run_command(cmd)
95100
=== modified file 'setup.py'
--- setup.py 2015-03-04 04:21:56 +0000
+++ setup.py 2015-04-14 22:36:38 +0000
@@ -21,13 +21,12 @@
21import sys21import sys
22assert sys.version_info >= (3,), 'Python 3 is required'22assert sys.version_info >= (3,), 'Python 3 is required'
2323
24from setuptools import find_packages, setup, Extension24from setuptools import find_packages, setup
2525
2626
27VERSION = '1.0.0'27VERSION = '1.0.0'
2828
2929
30
31setup(30setup(
32 name='adt-cloud-worker',31 name='adt-cloud-worker',
33 version=VERSION,32 version=VERSION,
3433
=== modified file 'test_requirements.txt'
--- test_requirements.txt 2015-03-04 21:44:54 +0000
+++ test_requirements.txt 2015-04-14 22:36:38 +0000
@@ -1,3 +1,4 @@
1testtools1testtools
2fixtures2fixtures
3flake8==2.4.0
34

Subscribers

People subscribed via source and target branches