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
=== modified file 'utah/client/phoenix.py'
--- utah/client/phoenix.py 2012-10-12 20:24:03 +0000
+++ utah/client/phoenix.py 2012-10-12 20:31:21 +0000
@@ -65,9 +65,10 @@
65 for f in self.FILE_CONTENT.keys():65 for f in self.FILE_CONTENT.keys():
66 fc = self.FILE_CONTENT[f]66 fc = self.FILE_CONTENT[f]
6767
68 def create_file(self, path, content):68 def create_file(self, path, content, append_if_exists=False):
69 if not os.path.exists(path):69 write_method = 'a' if append_if_exists else 'w'
70 with open(path, 'w') as fp:70 if not os.path.exists(path) or append_if_exists:
71 with open(path, write_method) as fp:
71 fp.write(content)72 fp.write(content)
72 fp.close()73 fp.close()
7374
@@ -90,7 +91,7 @@
9091
91 # create the tslist.run file92 # create the tslist.run file
92 tslist_file = os.path.join(ts_dir, TSLIST_NAME)93 tslist_file = os.path.join(ts_dir, TSLIST_NAME)
93 self.create_file(tslist_file, self.FILE_CONTENT[TSLIST_NAME])94 self.create_file(tslist_file, self.FILE_CONTENT[TSLIST_NAME], append_if_exists=True)
9495
95 # create the test case directories96 # create the test case directories
96 for tc in self.testcases:97 for tc in self.testcases:

Subscribers

People subscribed via source and target branches