Merge lp:~nuclearbob/utah/output-machine-name into lp:utah

Proposed by Max Brustkern
Status: Merged
Approved by: Javier Collado
Approved revision: 763
Merged at revision: 764
Proposed branch: lp:~nuclearbob/utah/output-machine-name
Merge into: lp:utah
Diff against target: 26 lines (+4/-1)
2 files modified
examples/utah_logs.sh (+1/-1)
utah/run.py (+3/-0)
To merge this branch: bzr merge lp:~nuclearbob/utah/output-machine-name
Reviewer Review Type Date Requested Status
Javier Collado (community) Approve
Review via email: mp+136981@code.launchpad.net

Description of the change

This branch writes the machine name to standard output when running any of the standard example test runner scripts that use run.py and updates the example log gathering script to use that name as the machine name.

To post a comment you must log in.
Revision history for this message
Javier Collado (javier.collado) wrote :

Thanks. This makes indeed the logs script more readable.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/utah_logs.sh'
2--- examples/utah_logs.sh 2012-11-16 21:21:17 +0000
3+++ examples/utah_logs.sh 2012-11-29 16:41:30 +0000
4@@ -1,7 +1,7 @@
5 #!/bin/bash
6
7 set +e
8-NAME=$(grep -m1 -o "utah-[0-9]*" log)
9+NAME=$(grep "^Running on machine:" log | sed 's/^Running on machine: //')
10 grep "$NAME" /var/log/utah/$(hostname).log* > fulllog
11 grep -qP "^\t/" log && cp $(grep -P "^\t/" log | sed 's/^\t//') .
12 mkdir -p clientlogs
13
14=== modified file 'utah/run.py'
15--- utah/run.py 2012-11-27 11:55:19 +0000
16+++ utah/run.py 2012-11-29 16:41:30 +0000
17@@ -19,6 +19,9 @@
18 if logger.level > logging.INFO:
19 logger.setLevel(logging.INFO)
20
21+ # Write the machine name to standard out for log gathering
22+ print('Running on machine: ' + machine.name)
23+
24 if args.json:
25 extraopts = ' -f json'
26 suffix = 'json'

Subscribers

People subscribed via source and target branches