Merge lp:~joetalbott/utah/phoenix_add_testcases_to_tslist into lp:utah

Proposed by Joe Talbott
Status: Merged
Merged at revision: 711
Proposed branch: lp:~joetalbott/utah/phoenix_add_testcases_to_tslist
Merge into: lp:utah
Diff against target: 26 lines (+5/-4)
1 file modified
utah/client/phoenix.py (+5/-4)
To merge this branch: bzr merge lp:~joetalbott/utah/phoenix_add_testcases_to_tslist
Reviewer Review Type Date Requested Status
Max Brustkern (community) Approve
Review via email: mp+129511@code.launchpad.net

Description of the change

After watching Max have to edit tslist.run after each invocation of 'phoenix . <blah>' I thought this might help.

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

Looks good to me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'utah/client/phoenix.py'
2--- utah/client/phoenix.py 2012-10-12 20:24:03 +0000
3+++ utah/client/phoenix.py 2012-10-12 20:31:21 +0000
4@@ -65,9 +65,10 @@
5 for f in self.FILE_CONTENT.keys():
6 fc = self.FILE_CONTENT[f]
7
8- def create_file(self, path, content):
9- if not os.path.exists(path):
10- with open(path, 'w') as fp:
11+ def create_file(self, path, content, append_if_exists=False):
12+ write_method = 'a' if append_if_exists else 'w'
13+ if not os.path.exists(path) or append_if_exists:
14+ with open(path, write_method) as fp:
15 fp.write(content)
16 fp.close()
17
18@@ -90,7 +91,7 @@
19
20 # create the tslist.run file
21 tslist_file = os.path.join(ts_dir, TSLIST_NAME)
22- self.create_file(tslist_file, self.FILE_CONTENT[TSLIST_NAME])
23+ self.create_file(tslist_file, self.FILE_CONTENT[TSLIST_NAME], append_if_exists=True)
24
25 # create the test case directories
26 for tc in self.testcases:

Subscribers

People subscribed via source and target branches