Merge lp:~javier.collado/utah/static_analysis_4 into lp:utah
- static_analysis_4
- Merge into dev
Status: | Merged |
---|---|
Approved by: | Javier Collado |
Approved revision: | 646 |
Merged at revision: | 640 |
Proposed branch: | lp:~javier.collado/utah/static_analysis_4 |
Merge into: | lp:utah |
Diff against target: |
611 lines (+91/-63) 21 files modified
examples/run_install_test.py (+2/-1) examples/run_test_vm.py (+2/-1) utah/client/common.py (+4/-1) utah/client/result.py (+3/-1) utah/client/runner.py (+5/-3) utah/client/testcase.py (+6/-4) utah/client/tests/common.py (+4/-1) utah/client/tests/manual_privileges.py (+1/-1) utah/client/tests/test_common.py (+2/-1) utah/client/tests/test_jsonschema.py (+10/-7) utah/client/tests/test_misc.py (+3/-1) utah/client/tests/test_result.py (+1/-1) utah/client/tests/test_runner.py (+4/-6) utah/client/tests/test_state_agent.py (+5/-7) utah/client/tests/test_testcase.py (+4/-3) utah/client/tests/test_testsuite.py (+5/-3) utah/client/tests/test_yaml.py (+8/-7) utah/client/testsuite.py (+6/-4) utah/provisioning/baremetal/cobbler.py (+2/-1) utah/provisioning/provisioning.py (+11/-6) utah/provisioning/vm/libvirtvm.py (+3/-3) |
To merge this branch: | bzr merge lp:~javier.collado/utah/static_analysis_4 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Joe Talbott (community) | Approve | ||
Javier Collado (community) | Needs Resubmitting | ||
Review via email: mp+118745@code.launchpad.net |
Commit message
Description of the change
One more round of static analysis changes
Please have a look at the commit messages for further information about the problems fixed
Joe Talbott (joetalbott) wrote : | # |
Javier Collado (javier.collado) wrote : | # |
That makes sense, I'll add again those imports then an resubmit. Thanks for your feedback.
- 607. By Max Brustkern
-
Added support for nested timeouts; outer timeout alwasy wins right
now - 608. By Max Brustkern
-
Merged Javier's packaging fix
- 609. By Max Brustkern
-
Added debhelper tokens to scripts
Javier Collado (javier.collado) wrote : | # |
@Joe
The imports that were mistakenly removed have been added again.
I wanted to verify if nosetests works fine and I got 20 errors mainly because:
- master.run file is missing
-/var/lib/
- and ...
Traceback (most recent call last):
File "/home/
self.
AssertionError: False is not true
I followed the instructions in utah_howto.txt, but something must be missing in my environment. Please could you let me know what did you do to set up yours? Thanks.
Joe Talbott (joetalbott) wrote : | # |
On Wed, Aug 08, 2012 at 04:30:27PM -0000, Javier Collado wrote:
> @Joe
> The imports that were mistakenly removed have been added again.
>
> I wanted to verify if nosetests works fine and I got 20 errors mainly because:
> - master.run file is missing
> -/var/lib/
> - and ...
> Traceback (most recent call last):
> File "/home/
> self.assertTrue
> AssertionError: False is not true
>
> I followed the instructions in utah_howto.txt, but something must be missing in my environment. Please could you let me know what did you do to set up yours? Thanks.
Have a look at utah/client/
required packages for testing. Also note that the recommended way is to
run the nosetests from the top-level of the repo. Also make sure you
clean out /var/lib/utah before running. If that fails let me know and
I'll pull your branch and check it out.
Thanks,
Joe
>
> --
> https:/
> Your team UTAH Dev is requested to review the proposed merge of lp:~javier.collado/utah/static_analysis_4 into lp:utah/dev.
Joe Talbott (joetalbott) wrote : | # |
On Wed, Aug 08, 2012 at 04:30:27PM -0000, Javier Collado wrote:
> @Joe
> The imports that were mistakenly removed have been added again.
>
> I wanted to verify if nosetests works fine and I got 20 errors mainly because:
> - master.run file is missing
> -/var/lib/
> - and ...
> Traceback (most recent call last):
> File "/home/
> self.assertTrue
> AssertionError: False is not true
>
> I followed the instructions in utah_howto.txt, but something must be missing in my environment. Please could you let me know what did you do to set up yours? Thanks.
Also make sure that the global setUp and tearDown methods are getting
called because they do some setting up of the environment as well.
>
> --
> https:/
> Your team UTAH Dev is requested to review the proposed merge of lp:~javier.collado/utah/static_analysis_4 into lp:utah/dev.
- 610. By Joe Talbott
-
Support timeout overrides from master.run to ts_control to
tc_control - 611. By Max Brustkern
-
Added exception for when client fails to install
- 612. By Joe Talbott
-
Merge Javier's LP URL work
Javier Collado (javier.collado) wrote : | # |
I've run the test cases for both precise and quantal with the packaged version of python-jsonschema and they passed successfully.
- 613. By Max Brustkern
-
Check for correct error when New option is not set to True
- 614. By Joe Talbott
-
Download and run testsuites in UTAH_DIR/testsuites
- 615. By Joe Talbott
-
Merge Javier's python-jsonschema work
- 616. By Joe Talbott
-
Remove extra 'testsuites' directory
- 617. By Max Brustkern
-
Merged Javier's changes for propagating exit status so exceptions still show
- 618. By Max Brustkern
-
Merged Javier's client installation related exceptions
- 619. By Max Brustkern
-
Merged Javier's readability improvements
- 620. By Max Brustkern
-
Merged Javier's change that Fixes 1034348
Javier Collado (javier.collado) wrote : | # |
@Joe
Please let me know if there's some other thing might be a concern. Thanks.
- 621. By Max Brustkern
-
Merged Javier's changes for clearer error reporting when file downloads fail
- 622. By Max Brustkern
-
Improved docstrings for non-provisioning modules
- 623. By Max Brustkern
-
This is in config.py now
- 624. By Max Brustkern
-
Removed old json files
- 625. By Max Brustkern
-
Improved documentation in provisioning
- 626. By Javier Collado
-
Merged lp:~nuclearbob/utah/packaging-changes
This fixes the problem of not being able to install both utah and utah-client
together. - 627. By Max Brustkern
-
Added diskbus option for VM creation
- 628. By Max Brustkern
-
Cleaning up stop method of libvirtvm
- 629. By Max Brustkern
-
Testing package version change
- 630. By Max Brustkern
-
Fixed postinst typo
- 631. By Max Brustkern
-
Merged Javier's default test case fixes
- 632. By Max Brustkern
-
Merged Javier's packaging changes
- 633. By Max Brustkern
-
Merged Javier's changes for new try blocks
- 634. By Max Brustkern
-
Merges Javier's gdebi changes
- 635. By Javier Collado
-
Merged fix from lp:~javier.collado/utah/bug1035231
Although package installation failures are reported, gdebi must be executed as
root for the succesful case. - 646. By Javier Collado
-
Added again the imports needed by nosetests
Used NOQA to skip flake8 error on those imports and added a comment to mark
clearly that they are needed even if they aren't used directly.
Javier Collado (javier.collado) wrote : | # |
I've rebased changes to make sure the merge is still easy to do (resolved one conflict).
Joe Talbott (joetalbott) wrote : | # |
Look good. Feel free to merge.
Preview Diff
1 | === modified file 'examples/run_install_test.py' | |||
2 | --- examples/run_install_test.py 2012-08-14 15:42:17 +0000 | |||
3 | +++ examples/run_install_test.py 2012-08-16 12:03:20 +0000 | |||
4 | @@ -100,7 +100,8 @@ | |||
5 | 100 | try: | 100 | try: |
6 | 101 | inventory.destroy(machine.machineid) | 101 | inventory.destroy(machine.machineid) |
7 | 102 | except UTAHException as error: | 102 | except UTAHException as error: |
9 | 103 | sys.stderr.write('Failed to update inventory: ' + str(error)) | 103 | sys.stderr.write('Failed to update inventory: ' |
10 | 104 | + str(error)) | ||
11 | 104 | finally: | 105 | finally: |
12 | 105 | del machine | 106 | del machine |
13 | 106 | if len(locallogs) != 0: | 107 | if len(locallogs) != 0: |
14 | 107 | 108 | ||
15 | === modified file 'examples/run_test_vm.py' | |||
16 | --- examples/run_test_vm.py 2012-07-31 20:54:02 +0000 | |||
17 | +++ examples/run_test_vm.py 2012-08-16 12:03:20 +0000 | |||
18 | @@ -77,7 +77,8 @@ | |||
19 | 77 | try: | 77 | try: |
20 | 78 | inventory.destroy(machine.machineid) | 78 | inventory.destroy(machine.machineid) |
21 | 79 | except UTAHException as error: | 79 | except UTAHException as error: |
23 | 80 | sys.stderr.write('Failed to update inventory: ' + str(error)) | 80 | sys.stderr.write('Failed to update inventory: ' |
24 | 81 | + str(error)) | ||
25 | 81 | finally: | 82 | finally: |
26 | 82 | del machine | 83 | del machine |
27 | 83 | if len(locallogs) != 0: | 84 | if len(locallogs) != 0: |
28 | 84 | 85 | ||
29 | === modified file 'utah/client/common.py' | |||
30 | --- utah/client/common.py 2012-08-09 20:14:54 +0000 | |||
31 | +++ utah/client/common.py 2012-08-16 12:03:20 +0000 | |||
32 | @@ -49,6 +49,7 @@ | |||
33 | 49 | CMD_TS_SETUP = 'testsuite_setup' | 49 | CMD_TS_SETUP = 'testsuite_setup' |
34 | 50 | CMD_TS_CLEANUP = 'testsuite_cleanup' | 50 | CMD_TS_CLEANUP = 'testsuite_cleanup' |
35 | 51 | 51 | ||
36 | 52 | |||
37 | 52 | def do_nothing(obj=None): | 53 | def do_nothing(obj=None): |
38 | 53 | """ | 54 | """ |
39 | 54 | Do nothing method used a placeholder for save_state_callbacks. | 55 | Do nothing method used a placeholder for save_state_callbacks. |
40 | @@ -266,6 +267,7 @@ | |||
41 | 266 | fp.close() | 267 | fp.close() |
42 | 267 | print("### End {} ###".format(artifact)) | 268 | print("### End {} ###".format(artifact)) |
43 | 268 | 269 | ||
44 | 270 | |||
45 | 269 | def get_media_info(): | 271 | def get_media_info(): |
46 | 270 | """ | 272 | """ |
47 | 271 | Get the contents of the media-info file if available. | 273 | Get the contents of the media-info file if available. |
48 | @@ -280,6 +282,7 @@ | |||
49 | 280 | 282 | ||
50 | 281 | return media_info | 283 | return media_info |
51 | 282 | 284 | ||
52 | 285 | |||
53 | 283 | def get_host_info(): | 286 | def get_host_info(): |
54 | 284 | """ | 287 | """ |
55 | 285 | Get host info, useful for debugging. | 288 | Get host info, useful for debugging. |
56 | @@ -292,6 +295,7 @@ | |||
57 | 292 | 295 | ||
58 | 293 | return retval | 296 | return retval |
59 | 294 | 297 | ||
60 | 298 | |||
61 | 295 | def get_api_config(): | 299 | def get_api_config(): |
62 | 296 | """ | 300 | """ |
63 | 297 | Parse the client configuration file for API configuration data. | 301 | Parse the client configuration file for API configuration data. |
64 | @@ -304,4 +308,3 @@ | |||
65 | 304 | data = json.load(fp) | 308 | data = json.load(fp) |
66 | 305 | 309 | ||
67 | 306 | return data['API'] | 310 | return data['API'] |
68 | 307 | |||
69 | 308 | 311 | ||
70 | === modified file 'utah/client/result.py' | |||
71 | --- utah/client/result.py 2012-08-02 16:03:40 +0000 | |||
72 | +++ utah/client/result.py 2012-08-16 12:03:20 +0000 | |||
73 | @@ -4,6 +4,7 @@ | |||
74 | 4 | 4 | ||
75 | 5 | from .common import get_host_info | 5 | from .common import get_host_info |
76 | 6 | 6 | ||
77 | 7 | |||
78 | 7 | class Result(object): | 8 | class Result(object): |
79 | 8 | """ | 9 | """ |
80 | 9 | Result collection class. | 10 | Result collection class. |
81 | @@ -132,7 +133,8 @@ | |||
82 | 132 | 'uname': list(host_info['uname']), | 133 | 'uname': list(host_info['uname']), |
83 | 133 | 'media-info': host_info['media-info'], | 134 | 'media-info': host_info['media-info'], |
84 | 134 | } | 135 | } |
86 | 135 | yaml.dump(data, sys.stdout, explicit_start='---', default_flow_style=False) | 136 | yaml.dump(data, sys.stdout, explicit_start='---', |
87 | 137 | default_flow_style=False) | ||
88 | 136 | 138 | ||
89 | 137 | status = self.status | 139 | status = self.status |
90 | 138 | self.clear_results() | 140 | self.clear_results() |
91 | 139 | 141 | ||
92 | === modified file 'utah/client/runner.py' | |||
93 | --- utah/client/runner.py 2012-08-09 20:14:54 +0000 | |||
94 | +++ utah/client/runner.py 2012-08-16 12:03:20 +0000 | |||
95 | @@ -270,7 +270,8 @@ | |||
96 | 270 | 270 | ||
97 | 271 | self.backup_runlist = os.path.join(self.testdir, 'master.run-reboot') | 271 | self.backup_runlist = os.path.join(self.testdir, 'master.run-reboot') |
98 | 272 | 272 | ||
100 | 273 | if os.path.exists(self.master_runlist) and self.master_runlist != self.backup_runlist: | 273 | if (os.path.exists(self.master_runlist) |
101 | 274 | and self.master_runlist != self.backup_runlist): | ||
102 | 274 | shutil.copyfile(self.master_runlist, self.backup_runlist) | 275 | shutil.copyfile(self.master_runlist, self.backup_runlist) |
103 | 275 | 276 | ||
104 | 276 | state = { | 277 | state = { |
105 | @@ -326,7 +327,7 @@ | |||
106 | 326 | # local filename if needed (it might be a local file already or cached) | 327 | # local filename if needed (it might be a local file already or cached) |
107 | 327 | try: | 328 | try: |
108 | 328 | local_filename = urllib.urlretrieve(runlist)[0] | 329 | local_filename = urllib.urlretrieve(runlist)[0] |
110 | 329 | except IOError as e: | 330 | except IOError: |
111 | 330 | raise exceptions.MissingFile(runlist) | 331 | raise exceptions.MissingFile(runlist) |
112 | 331 | 332 | ||
113 | 332 | data = parse_yaml_file(local_filename) | 333 | data = parse_yaml_file(local_filename) |
114 | @@ -372,7 +373,8 @@ | |||
115 | 372 | 373 | ||
116 | 373 | if name not in self.fetched_suites: | 374 | if name not in self.fetched_suites: |
117 | 374 | if fetch_cmd is not None: | 375 | if fetch_cmd is not None: |
119 | 375 | self.result.add_result(run_cmd(fetch_cmd, cwd=name, cmd_type=CMD_TS_FETCH)) | 376 | self.result.add_result(run_cmd(fetch_cmd, cwd=name, |
120 | 377 | cmd_type=CMD_TS_FETCH)) | ||
121 | 376 | self.fetched_suites.append(name) | 378 | self.fetched_suites.append(name) |
122 | 377 | 379 | ||
123 | 378 | # If fetch_cmd failed move on to the next testsuite. | 380 | # If fetch_cmd failed move on to the next testsuite. |
124 | 379 | 381 | ||
125 | === modified file 'utah/client/testcase.py' | |||
126 | --- utah/client/testcase.py 2012-08-10 17:12:13 +0000 | |||
127 | +++ utah/client/testcase.py 2012-08-16 12:03:20 +0000 | |||
128 | @@ -5,7 +5,6 @@ | |||
129 | 5 | from common import run_cmd, parse_control_file | 5 | from common import run_cmd, parse_control_file |
130 | 6 | from common import do_nothing | 6 | from common import do_nothing |
131 | 7 | from common import CMD_TC_BUILD, CMD_TC_SETUP, CMD_TC_TEST, CMD_TC_CLEANUP | 7 | from common import CMD_TC_BUILD, CMD_TC_SETUP, CMD_TC_TEST, CMD_TC_CLEANUP |
132 | 8 | from result import Result | ||
133 | 9 | from exceptions import MissingFile | 8 | from exceptions import MissingFile |
134 | 10 | 9 | ||
135 | 11 | 10 | ||
136 | @@ -113,7 +112,8 @@ | |||
137 | 113 | """ | 112 | """ |
138 | 114 | if self.status == 'NOTRUN': | 113 | if self.status == 'NOTRUN': |
139 | 115 | self.set_status('BUILD') | 114 | self.set_status('BUILD') |
141 | 116 | result.add_result(run_cmd(self.build_cmd, cwd=self.working_dir, cmd_type=CMD_TC_BUILD)) | 115 | result.add_result(run_cmd(self.build_cmd, cwd=self.working_dir, |
142 | 116 | cmd_type=CMD_TC_BUILD)) | ||
143 | 117 | 117 | ||
144 | 118 | def setup(self, result): | 118 | def setup(self, result): |
145 | 119 | """ | 119 | """ |
146 | @@ -121,7 +121,8 @@ | |||
147 | 121 | """ | 121 | """ |
148 | 122 | if self.status == 'BUILD' and result.status == 'PASS': | 122 | if self.status == 'BUILD' and result.status == 'PASS': |
149 | 123 | self.set_status('SETUP') | 123 | self.set_status('SETUP') |
151 | 124 | result.add_result(run_cmd(self.tc_setup, cwd=self.working_dir, cmd_type=CMD_TC_SETUP)) | 124 | result.add_result(run_cmd(self.tc_setup, cwd=self.working_dir, |
152 | 125 | cmd_type=CMD_TC_SETUP)) | ||
153 | 125 | 126 | ||
154 | 126 | def cleanup(self, result): | 127 | def cleanup(self, result): |
155 | 127 | """ | 128 | """ |
156 | @@ -129,7 +130,8 @@ | |||
157 | 129 | """ | 130 | """ |
158 | 130 | if self.status == 'RUN': | 131 | if self.status == 'RUN': |
159 | 131 | self.set_status('CLEANUP') | 132 | self.set_status('CLEANUP') |
161 | 132 | result.add_result(run_cmd(self.tc_cleanup, cwd=self.working_dir, cmd_type=CMD_TC_CLEANUP)) | 133 | result.add_result(run_cmd(self.tc_cleanup, cwd=self.working_dir, |
162 | 134 | cmd_type=CMD_TC_CLEANUP)) | ||
163 | 133 | 135 | ||
164 | 134 | def run(self): | 136 | def run(self): |
165 | 135 | """ | 137 | """ |
166 | 136 | 138 | ||
167 | === modified file 'utah/client/tests/common.py' | |||
168 | --- utah/client/tests/common.py 2012-08-09 20:14:54 +0000 | |||
169 | +++ utah/client/tests/common.py 2012-08-16 12:03:20 +0000 | |||
170 | @@ -1,7 +1,8 @@ | |||
171 | 1 | import os | 1 | import os |
172 | 2 | import shutil | 2 | import shutil |
173 | 3 | 3 | ||
175 | 4 | from utah.client.common import UTAH_DIR, MASTER_RUNLIST, UTAH_CLIENT | 4 | from utah.client.common import UTAH_DIR, MASTER_RUNLIST |
176 | 5 | |||
177 | 5 | 6 | ||
178 | 6 | def get_module_path(): | 7 | def get_module_path(): |
179 | 7 | """ | 8 | """ |
180 | @@ -39,6 +40,7 @@ | |||
181 | 39 | #examples_source = os.path.join(UTAH_CLIENT, 'examples') | 40 | #examples_source = os.path.join(UTAH_CLIENT, 'examples') |
182 | 40 | examples_source = os.path.join(get_module_path(), 'client', 'examples') | 41 | examples_source = os.path.join(get_module_path(), 'client', 'examples') |
183 | 41 | 42 | ||
184 | 43 | |||
185 | 42 | def setUp(): | 44 | def setUp(): |
186 | 43 | """ | 45 | """ |
187 | 44 | Set up a master.run file that will copy our 'examples' directory to the | 46 | Set up a master.run file that will copy our 'examples' directory to the |
188 | @@ -61,6 +63,7 @@ | |||
189 | 61 | fp.write(master_runlist_content) | 63 | fp.write(master_runlist_content) |
190 | 62 | fp.close() | 64 | fp.close() |
191 | 63 | 65 | ||
192 | 66 | |||
193 | 64 | def tearDown(): | 67 | def tearDown(): |
194 | 65 | """ | 68 | """ |
195 | 66 | Cleanup after ourselves. | 69 | Cleanup after ourselves. |
196 | 67 | 70 | ||
197 | === modified file 'utah/client/tests/manual_privileges.py' | |||
198 | --- utah/client/tests/manual_privileges.py 2012-08-01 17:25:20 +0000 | |||
199 | +++ utah/client/tests/manual_privileges.py 2012-08-16 12:03:20 +0000 | |||
200 | @@ -116,6 +116,7 @@ | |||
201 | 116 | print_priv("after") | 116 | print_priv("after") |
202 | 117 | _do_cmd("id") | 117 | _do_cmd("id") |
203 | 118 | 118 | ||
204 | 119 | |||
205 | 119 | class TestPriv(baseTestPriv): | 120 | class TestPriv(baseTestPriv): |
206 | 120 | def test_drop_priv(self): | 121 | def test_drop_priv(self): |
207 | 121 | """ | 122 | """ |
208 | @@ -170,4 +171,3 @@ | |||
209 | 170 | }) | 171 | }) |
210 | 171 | 172 | ||
211 | 172 | _do_cmd("id") | 173 | _do_cmd("id") |
212 | 173 | |||
213 | 174 | 174 | ||
214 | === modified file 'utah/client/tests/test_common.py' | |||
215 | --- utah/client/tests/test_common.py 2012-07-31 19:40:18 +0000 | |||
216 | +++ utah/client/tests/test_common.py 2012-08-16 12:03:20 +0000 | |||
217 | @@ -10,6 +10,7 @@ | |||
218 | 10 | CONFIG, | 10 | CONFIG, |
219 | 11 | ) | 11 | ) |
220 | 12 | 12 | ||
221 | 13 | |||
222 | 13 | class TestCommon(unittest.TestCase): | 14 | class TestCommon(unittest.TestCase): |
223 | 14 | """ | 15 | """ |
224 | 15 | Tests for utah.client.common. | 16 | Tests for utah.client.common. |
225 | @@ -35,7 +36,7 @@ | |||
226 | 35 | host_info = get_host_info() | 36 | host_info = get_host_info() |
227 | 36 | 37 | ||
228 | 37 | print("host_info: {}".format(host_info)) | 38 | print("host_info: {}".format(host_info)) |
230 | 38 | 39 | ||
231 | 39 | self.assertTrue(host_info is not None) | 40 | self.assertTrue(host_info is not None) |
232 | 40 | 41 | ||
233 | 41 | def test_run_cmd(self): | 42 | def test_run_cmd(self): |
234 | 42 | 43 | ||
235 | === modified file 'utah/client/tests/test_jsonschema.py' | |||
236 | --- utah/client/tests/test_jsonschema.py 2012-08-06 19:16:38 +0000 | |||
237 | +++ utah/client/tests/test_jsonschema.py 2012-08-16 12:03:20 +0000 | |||
238 | @@ -27,22 +27,23 @@ | |||
239 | 27 | testsuties: | 27 | testsuties: |
240 | 28 | - name: testsuite1 | 28 | - name: testsuite1 |
241 | 29 | fetch_cmd: fetch1 | 29 | fetch_cmd: fetch1 |
243 | 30 | """, # typo | 30 | """, # typo |
244 | 31 | """--- | 31 | """--- |
245 | 32 | timeout: 101 | 32 | timeout: 101 |
246 | 33 | repeat_count: 99 | 33 | repeat_count: 99 |
248 | 34 | """, # missing testsuites | 34 | """, # missing testsuites |
249 | 35 | """--- | 35 | """--- |
250 | 36 | - name: blah | 36 | - name: blah |
251 | 37 | - name: blip | 37 | - name: blip |
253 | 38 | """, # missing fetch_cmds | 38 | """, # missing fetch_cmds |
254 | 39 | """--- | 39 | """--- |
255 | 40 | testsuites: | 40 | testsuites: |
256 | 41 | - name: blah | 41 | - name: blah |
257 | 42 | - name: blip | 42 | - name: blip |
259 | 43 | """, # missing fetch_cmds | 43 | """, # missing fetch_cmds |
260 | 44 | ] | 44 | ] |
261 | 45 | 45 | ||
262 | 46 | |||
263 | 46 | class TestJSONSchema(unittest.TestCase): | 47 | class TestJSONSchema(unittest.TestCase): |
264 | 47 | 48 | ||
265 | 48 | def test_orig_schema(self): | 49 | def test_orig_schema(self): |
266 | @@ -64,7 +65,8 @@ | |||
267 | 64 | jsonschema.validate(data_new, Runner.MASTER_RUNLIST_SCHEMA) | 65 | jsonschema.validate(data_new, Runner.MASTER_RUNLIST_SCHEMA) |
268 | 65 | 66 | ||
269 | 66 | def test_example_runlist(self): | 67 | def test_example_runlist(self): |
271 | 67 | example_runlist = os.path.join(os.path.dirname(__file__), "../examples/master.run") | 68 | example_runlist = os.path.join(os.path.dirname(__file__), |
272 | 69 | "../examples/master.run") | ||
273 | 68 | 70 | ||
274 | 69 | self.assertTrue(os.path.exists(example_runlist)) | 71 | self.assertTrue(os.path.exists(example_runlist)) |
275 | 70 | 72 | ||
276 | @@ -74,7 +76,6 @@ | |||
277 | 74 | jsonschema.validate(data, Runner.MASTER_RUNLIST_SCHEMA) | 76 | jsonschema.validate(data, Runner.MASTER_RUNLIST_SCHEMA) |
278 | 75 | fp.close() | 77 | fp.close() |
279 | 76 | 78 | ||
280 | 77 | |||
281 | 78 | def test_bad_schemas(self): | 79 | def test_bad_schemas(self): |
282 | 79 | """ | 80 | """ |
283 | 80 | Test that required fields are enforced by the schema. | 81 | Test that required fields are enforced by the schema. |
284 | @@ -83,4 +84,6 @@ | |||
285 | 83 | for content in yaml_content_bad: | 84 | for content in yaml_content_bad: |
286 | 84 | data = yaml.load(content) | 85 | data = yaml.load(content) |
287 | 85 | print("data: {}".format(data)) | 86 | print("data: {}".format(data)) |
289 | 86 | self.assertRaises(jsonschema.ValidationError, jsonschema.validate, data, Runner.MASTER_RUNLIST_SCHEMA) | 87 | self.assertRaises(jsonschema.ValidationError, |
290 | 88 | jsonschema.validate, | ||
291 | 89 | data, Runner.MASTER_RUNLIST_SCHEMA) | ||
292 | 87 | 90 | ||
293 | === modified file 'utah/client/tests/test_misc.py' | |||
294 | --- utah/client/tests/test_misc.py 2012-08-06 19:40:22 +0000 | |||
295 | +++ utah/client/tests/test_misc.py 2012-08-16 12:03:20 +0000 | |||
296 | @@ -3,11 +3,13 @@ | |||
297 | 3 | 3 | ||
298 | 4 | from .common import get_module_path | 4 | from .common import get_module_path |
299 | 5 | 5 | ||
300 | 6 | |||
301 | 6 | class TestMisc(unittest.TestCase): | 7 | class TestMisc(unittest.TestCase): |
302 | 7 | def test_get_module_path(self): | 8 | def test_get_module_path(self): |
303 | 8 | 9 | ||
304 | 9 | print("__file__: {}".format(__file__)) | 10 | print("__file__: {}".format(__file__)) |
305 | 10 | 11 | ||
306 | 11 | # assumes this file is in 'utah/client/tests' | 12 | # assumes this file is in 'utah/client/tests' |
308 | 12 | file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../")) | 13 | file_path = os.path.abspath(os.path.join(os.path.dirname(__file__), |
309 | 14 | "../../")) | ||
310 | 13 | self.assertEqual(file_path, get_module_path()) | 15 | self.assertEqual(file_path, get_module_path()) |
311 | 14 | 16 | ||
312 | === modified file 'utah/client/tests/test_result.py' | |||
313 | --- utah/client/tests/test_result.py 2012-07-30 14:27:12 +0000 | |||
314 | +++ utah/client/tests/test_result.py 2012-08-16 12:03:20 +0000 | |||
315 | @@ -6,6 +6,7 @@ | |||
316 | 6 | ResultYAML, | 6 | ResultYAML, |
317 | 7 | ) | 7 | ) |
318 | 8 | 8 | ||
319 | 9 | |||
320 | 9 | class TestResult(unittest.TestCase): | 10 | class TestResult(unittest.TestCase): |
321 | 10 | def setUp(self): | 11 | def setUp(self): |
322 | 11 | self.result_yaml = ResultYAML("result_yaml") | 12 | self.result_yaml = ResultYAML("result_yaml") |
323 | @@ -118,4 +119,3 @@ | |||
324 | 118 | self.assertEqual(result['returncode'], self.result['returncode']) | 119 | self.assertEqual(result['returncode'], self.result['returncode']) |
325 | 119 | self.assertEqual(result['stdout'], self.result['stdout']) | 120 | self.assertEqual(result['stdout'], self.result['stdout']) |
326 | 120 | self.assertEqual(result['stderr'], self.result['stderr']) | 121 | self.assertEqual(result['stderr'], self.result['stderr']) |
327 | 121 | |||
328 | 122 | 122 | ||
329 | === modified file 'utah/client/tests/test_runner.py' | |||
330 | --- utah/client/tests/test_runner.py 2012-08-09 20:14:54 +0000 | |||
331 | +++ utah/client/tests/test_runner.py 2012-08-16 12:03:20 +0000 | |||
332 | @@ -8,15 +8,13 @@ | |||
333 | 8 | from utah.client.common import RETURN_CODES | 8 | from utah.client.common import RETURN_CODES |
334 | 9 | from utah.client import exceptions | 9 | from utah.client import exceptions |
335 | 10 | 10 | ||
338 | 11 | from .common import setUp, tearDown | 11 | from .common import ( # NOQA |
339 | 12 | from .common import ( | 12 | setUp, # Used by nosetests |
340 | 13 | tearDown, # Used by nosetests | ||
341 | 13 | master_runlist_content, | 14 | master_runlist_content, |
342 | 14 | master_runlist, | ||
343 | 15 | master_runlist_bak, | ||
344 | 16 | examples_dir, | ||
345 | 17 | examples_source, | ||
346 | 18 | ) | 15 | ) |
347 | 19 | 16 | ||
348 | 17 | |||
349 | 20 | class TestRunner(unittest.TestCase): | 18 | class TestRunner(unittest.TestCase): |
350 | 21 | def setUp(self): | 19 | def setUp(self): |
351 | 22 | self.result_class = ResultYAML | 20 | self.result_class = ResultYAML |
352 | 23 | 21 | ||
353 | === modified file 'utah/client/tests/test_state_agent.py' | |||
354 | --- utah/client/tests/test_state_agent.py 2012-08-09 20:14:54 +0000 | |||
355 | +++ utah/client/tests/test_state_agent.py 2012-08-16 12:03:20 +0000 | |||
356 | @@ -6,14 +6,11 @@ | |||
357 | 6 | from utah.client.state_agent import StateAgentYAML | 6 | from utah.client.state_agent import StateAgentYAML |
358 | 7 | from utah.client.runner import Runner | 7 | from utah.client.runner import Runner |
359 | 8 | from utah.client.result import ResultYAML | 8 | from utah.client.result import ResultYAML |
364 | 9 | from utah.client.common import ( | 9 | from utah.client.common import UTAH_DIR |
361 | 10 | run_cmd, | ||
362 | 11 | UTAH_DIR, | ||
363 | 12 | ) | ||
365 | 13 | 10 | ||
369 | 14 | from .common import ( | 11 | from .common import ( # NOQA |
370 | 15 | setUp, | 12 | setUp, # Used by nosetests |
371 | 16 | tearDown, | 13 | tearDown, # Used by nosetests |
372 | 17 | get_module_path, | 14 | get_module_path, |
373 | 18 | ) | 15 | ) |
374 | 19 | 16 | ||
375 | @@ -70,6 +67,7 @@ | |||
376 | 70 | ts_setup: null | 67 | ts_setup: null |
377 | 71 | """ | 68 | """ |
378 | 72 | 69 | ||
379 | 70 | |||
380 | 73 | class TestStateAgentYAML(unittest.TestCase): | 71 | class TestStateAgentYAML(unittest.TestCase): |
381 | 74 | def setUp(self): | 72 | def setUp(self): |
382 | 75 | """ | 73 | """ |
383 | 76 | 74 | ||
384 | === modified file 'utah/client/tests/test_testcase.py' | |||
385 | --- utah/client/tests/test_testcase.py 2012-08-09 20:14:54 +0000 | |||
386 | +++ utah/client/tests/test_testcase.py 2012-08-16 12:03:20 +0000 | |||
387 | @@ -7,11 +7,12 @@ | |||
388 | 7 | ) | 7 | ) |
389 | 8 | from utah.client import testcase | 8 | from utah.client import testcase |
390 | 9 | 9 | ||
394 | 10 | from .common import ( | 10 | from .common import ( # NOQA |
395 | 11 | setUp, | 11 | setUp, # Used by nosetests |
396 | 12 | tearDown, | 12 | tearDown, # Used by nosetests |
397 | 13 | ) | 13 | ) |
398 | 14 | 14 | ||
399 | 15 | |||
400 | 15 | class TestTestCase(unittest.TestCase): | 16 | class TestTestCase(unittest.TestCase): |
401 | 16 | """ | 17 | """ |
402 | 17 | Tests for the TestCase class. | 18 | Tests for the TestCase class. |
403 | 18 | 19 | ||
404 | === modified file 'utah/client/tests/test_testsuite.py' | |||
405 | --- utah/client/tests/test_testsuite.py 2012-08-09 20:14:54 +0000 | |||
406 | +++ utah/client/tests/test_testsuite.py 2012-08-16 12:03:20 +0000 | |||
407 | @@ -7,14 +7,16 @@ | |||
408 | 7 | from utah.client.result import ResultYAML | 7 | from utah.client.result import ResultYAML |
409 | 8 | from utah.client import testsuite | 8 | from utah.client import testsuite |
410 | 9 | 9 | ||
414 | 10 | from .common import ( | 10 | from .common import ( # NOQA |
415 | 11 | setUp, | 11 | setUp, # Used by nosetests |
416 | 12 | tearDown, | 12 | tearDown, # Used by nosetests |
417 | 13 | ) | 13 | ) |
418 | 14 | 14 | ||
419 | 15 | |||
420 | 15 | def state_saver(): | 16 | def state_saver(): |
421 | 16 | debug_print("Saving state", force=True) | 17 | debug_print("Saving state", force=True) |
422 | 17 | 18 | ||
423 | 19 | |||
424 | 18 | class TestTestSuite(unittest.TestCase): | 20 | class TestTestSuite(unittest.TestCase): |
425 | 19 | """ | 21 | """ |
426 | 20 | Tests for the TestSuite class. | 22 | Tests for the TestSuite class. |
427 | 21 | 23 | ||
428 | === modified file 'utah/client/tests/test_yaml.py' | |||
429 | --- utah/client/tests/test_yaml.py 2012-07-27 19:42:26 +0000 | |||
430 | +++ utah/client/tests/test_yaml.py 2012-08-16 12:03:20 +0000 | |||
431 | @@ -1,18 +1,19 @@ | |||
432 | 1 | import unittest | 1 | import unittest |
433 | 2 | import yaml | 2 | import yaml |
434 | 3 | 3 | ||
435 | 4 | |||
436 | 4 | class TestYAML(unittest.TestCase): | 5 | class TestYAML(unittest.TestCase): |
437 | 5 | def test_parts(self): | 6 | def test_parts(self): |
438 | 6 | content = {} | 7 | content = {} |
439 | 7 | content['metadata'] = { | 8 | content['metadata'] = { |
442 | 8 | 'runlist' : '/tmp/master.run', | 9 | 'runlist': '/tmp/master.run', |
443 | 9 | 'host' : 'Ubuntu 12.04 LTS', | 10 | 'host': 'Ubuntu 12.04 LTS', |
444 | 10 | } | 11 | } |
445 | 11 | content['commands'] = [ | 12 | content['commands'] = [ |
446 | 12 | { | 13 | { |
450 | 13 | 'command' : 'rm -f blah', | 14 | 'command': 'rm -f blah', |
451 | 14 | 'stdout' : '', | 15 | 'stdout': '', |
452 | 15 | 'stderr' : '', | 16 | 'stderr': '', |
453 | 16 | } | 17 | } |
454 | 17 | ] | 18 | ] |
455 | 18 | 19 | ||
456 | @@ -26,7 +27,7 @@ | |||
457 | 26 | 27 | ||
458 | 27 | def test_parts_2(self): | 28 | def test_parts_2(self): |
459 | 28 | content = { | 29 | content = { |
461 | 29 | 'file' : '/tmp/file' | 30 | 'file': '/tmp/file' |
462 | 30 | } | 31 | } |
463 | 31 | 32 | ||
464 | 32 | extra_args = { | 33 | extra_args = { |
465 | @@ -63,7 +64,7 @@ | |||
466 | 63 | extra_args = {} | 64 | extra_args = {} |
467 | 64 | content = [ | 65 | content = [ |
468 | 65 | { | 66 | { |
470 | 66 | 'file' : '/tmp/file', | 67 | 'file': '/tmp/file', |
471 | 67 | }, | 68 | }, |
472 | 68 | [ | 69 | [ |
473 | 69 | { | 70 | { |
474 | 70 | 71 | ||
475 | === modified file 'utah/client/testsuite.py' | |||
476 | --- utah/client/testsuite.py 2012-08-08 21:10:05 +0000 | |||
477 | +++ utah/client/testsuite.py 2012-08-16 12:03:20 +0000 | |||
478 | @@ -6,7 +6,6 @@ | |||
479 | 6 | from common import DEFAULT_TSLIST, DEFAULT_TSCONTROL | 6 | from common import DEFAULT_TSLIST, DEFAULT_TSCONTROL |
480 | 7 | from common import CMD_TS_BUILD, CMD_TS_SETUP, CMD_TS_CLEANUP | 7 | from common import CMD_TS_BUILD, CMD_TS_SETUP, CMD_TS_CLEANUP |
481 | 8 | from common import do_nothing | 8 | from common import do_nothing |
482 | 9 | from result import Result | ||
483 | 10 | import jsonschema | 9 | import jsonschema |
484 | 11 | 10 | ||
485 | 12 | import os | 11 | import os |
486 | @@ -166,7 +165,8 @@ | |||
487 | 166 | """ | 165 | """ |
488 | 167 | if self.status == 'NOTRUN': | 166 | if self.status == 'NOTRUN': |
489 | 168 | self.set_status('BUILD') | 167 | self.set_status('BUILD') |
491 | 169 | result.add_result(run_cmd(self.build_cmd, cwd=self.name, cmd_type=CMD_TS_BUILD)) | 168 | result.add_result(run_cmd(self.build_cmd, cwd=self.name, |
492 | 169 | cmd_type=CMD_TS_BUILD)) | ||
493 | 170 | 170 | ||
494 | 171 | def setup(self, result): | 171 | def setup(self, result): |
495 | 172 | """ | 172 | """ |
496 | @@ -174,7 +174,8 @@ | |||
497 | 174 | """ | 174 | """ |
498 | 175 | if self.status == 'BUILD' and result.status == 'PASS': | 175 | if self.status == 'BUILD' and result.status == 'PASS': |
499 | 176 | self.set_status('SETUP') | 176 | self.set_status('SETUP') |
501 | 177 | result.add_result(run_cmd(self.ts_setup, cwd=self.name, cmd_type=CMD_TS_SETUP)) | 177 | result.add_result(run_cmd(self.ts_setup, cwd=self.name, |
502 | 178 | cmd_type=CMD_TS_SETUP)) | ||
503 | 178 | 179 | ||
504 | 179 | def cleanup(self, result): | 180 | def cleanup(self, result): |
505 | 180 | """ | 181 | """ |
506 | @@ -182,7 +183,8 @@ | |||
507 | 182 | """ | 183 | """ |
508 | 183 | if self.status == 'INPROGRESS': | 184 | if self.status == 'INPROGRESS': |
509 | 184 | self.set_status('CLEANUP') | 185 | self.set_status('CLEANUP') |
511 | 185 | result.add_result(run_cmd(self.ts_cleanup, cwd=self.name, cmd_type=CMD_TS_CLEANUP)) | 186 | result.add_result(run_cmd(self.ts_cleanup, cwd=self.name, |
512 | 187 | cmd_type=CMD_TS_CLEANUP)) | ||
513 | 186 | 188 | ||
514 | 187 | def run(self): | 189 | def run(self): |
515 | 188 | """ | 190 | """ |
516 | 189 | 191 | ||
517 | === modified file 'utah/provisioning/baremetal/cobbler.py' | |||
518 | --- utah/provisioning/baremetal/cobbler.py 2012-08-03 21:44:39 +0000 | |||
519 | +++ utah/provisioning/baremetal/cobbler.py 2012-08-16 12:03:20 +0000 | |||
520 | @@ -132,7 +132,8 @@ | |||
521 | 132 | for name in (dirnames + filenames): | 132 | for name in (dirnames + filenames): |
522 | 133 | filename = os.path.join(dirpath, name) | 133 | filename = os.path.join(dirpath, name) |
523 | 134 | if not os.path.islink(filename): | 134 | if not os.path.islink(filename): |
525 | 135 | self.logger.debug('Changing permissions of ' + filename) | 135 | self.logger.debug('Changing permissions of ' |
526 | 136 | + filename) | ||
527 | 136 | os.chmod(filename, 0775) | 137 | os.chmod(filename, 0775) |
528 | 137 | shutil.rmtree(self.tmpdir) | 138 | shutil.rmtree(self.tmpdir) |
529 | 138 | 139 | ||
530 | 139 | 140 | ||
531 | === modified file 'utah/provisioning/provisioning.py' | |||
532 | --- utah/provisioning/provisioning.py 2012-08-15 09:35:14 +0000 | |||
533 | +++ utah/provisioning/provisioning.py 2012-08-16 12:03:20 +0000 | |||
534 | @@ -504,14 +504,16 @@ | |||
535 | 504 | self.logger.info('Uploading ' + localpath | 504 | self.logger.info('Uploading ' + localpath |
536 | 505 | + ' from the host to ' + target | 505 | + ' from the host to ' + target |
537 | 506 | + ' on the machine') | 506 | + ' on the machine') |
539 | 507 | remotepath = os.path.join(target, os.path.basename(localpath)) | 507 | remotepath = os.path.join(target, |
540 | 508 | os.path.basename(localpath)) | ||
541 | 508 | sftp_client.put(localpath, remotepath) | 509 | sftp_client.put(localpath, remotepath) |
542 | 509 | else: | 510 | else: |
543 | 510 | failed.append(localpath) | 511 | failed.append(localpath) |
544 | 511 | finally: | 512 | finally: |
545 | 512 | sftp_client.close() | 513 | sftp_client.close() |
546 | 513 | if len(failed) > 0: | 514 | if len(failed) > 0: |
548 | 514 | err = UTAHProvisioningException('Files do not exist: ' + ' '.join(failed)) | 515 | err = UTAHProvisioningException('Files do not exist: ' |
549 | 516 | + ' '.join(failed)) | ||
550 | 515 | err.files = failed | 517 | err.files = failed |
551 | 516 | raise err | 518 | raise err |
552 | 517 | 519 | ||
553 | @@ -554,7 +556,8 @@ | |||
554 | 554 | self.ssh_client.connect(self.name, | 556 | self.ssh_client.connect(self.name, |
555 | 555 | key_filename=config.sshprivatekey) | 557 | key_filename=config.sshprivatekey) |
556 | 556 | sftp_client = self.ssh_client.open_sftp() | 558 | sftp_client = self.ssh_client.open_sftp() |
558 | 557 | files = [os.path.join(dirname, myfile) for myfile in sftp_client.listdir(dirname)] | 559 | files = [os.path.join(dirname, myfile) |
559 | 560 | for myfile in sftp_client.listdir(dirname)] | ||
560 | 558 | self.downloadfiles(files, target) | 561 | self.downloadfiles(files, target) |
561 | 559 | 562 | ||
562 | 560 | def destroy(self, *args, **kw): | 563 | def destroy(self, *args, **kw): |
563 | @@ -605,13 +608,15 @@ | |||
564 | 605 | except socket.error as err: | 608 | except socket.error as err: |
565 | 606 | raise UTAHProvisioningException(str(err), retry=True) | 609 | raise UTAHProvisioningException(str(err), retry=True) |
566 | 607 | 610 | ||
568 | 608 | def sshpoll(self, timeout=config.boottimeout, checktimeout=config.checktimeout, logmethod=None): | 611 | def sshpoll(self, timeout=config.boottimeout, |
569 | 612 | checktimeout=config.checktimeout, logmethod=None): | ||
570 | 609 | """ | 613 | """ |
571 | 610 | Run sshcheck over and over until timeout expires. | 614 | Run sshcheck over and over until timeout expires. |
572 | 611 | """ | 615 | """ |
573 | 612 | if logmethod is None: | 616 | if logmethod is None: |
576 | 613 | logmethod=self.logger.debug | 617 | logmethod = self.logger.debug |
577 | 614 | utah.timeout.timeout(timeout, retry, self.sshcheck, checktimeout, logmethod=logmethod) | 618 | utah.timeout.timeout(timeout, retry, self.sshcheck, checktimeout, |
578 | 619 | logmethod=logmethod) | ||
579 | 615 | 620 | ||
580 | 616 | 621 | ||
581 | 617 | class CustomInstallMixin(object): | 622 | class CustomInstallMixin(object): |
582 | 618 | 623 | ||
583 | === modified file 'utah/provisioning/vm/libvirtvm.py' | |||
584 | --- utah/provisioning/vm/libvirtvm.py 2012-08-14 16:50:47 +0000 | |||
585 | +++ utah/provisioning/vm/libvirtvm.py 2012-08-16 12:03:20 +0000 | |||
586 | @@ -6,7 +6,6 @@ | |||
587 | 6 | import string | 6 | import string |
588 | 7 | import subprocess | 7 | import subprocess |
589 | 8 | import tempfile | 8 | import tempfile |
590 | 9 | import time | ||
591 | 10 | 9 | ||
592 | 11 | from xml.etree import ElementTree | 10 | from xml.etree import ElementTree |
593 | 12 | 11 | ||
594 | @@ -24,7 +23,6 @@ | |||
595 | 24 | ) | 23 | ) |
596 | 25 | from utah import config | 24 | from utah import config |
597 | 26 | from utah.process import ProcessChecker | 25 | from utah.process import ProcessChecker |
598 | 27 | import utah.timeout | ||
599 | 28 | 26 | ||
600 | 29 | 27 | ||
601 | 30 | class LibvirtVM(VM): | 28 | class LibvirtVM(VM): |
602 | @@ -336,7 +334,9 @@ | |||
603 | 336 | for myfile in files: | 334 | for myfile in files: |
604 | 337 | self.logger.info('Uploading ' + myfile | 335 | self.logger.info('Uploading ' + myfile |
605 | 338 | + ' from the host to ' + target + ' on the VM') | 336 | + ' from the host to ' + target + ' on the VM') |
607 | 339 | if self._runargs(['vm-scp', '-f', '-p', self.name, myfile, target]) != 0: | 337 | returncode = self._runargs(['vm-scp', '-f', '-p', |
608 | 338 | self.name, myfile, target]) | ||
609 | 339 | if returncode != 0: | ||
610 | 340 | success = False | 340 | success = False |
611 | 341 | return success | 341 | return success |
612 | 342 | 342 |
On Wed, Aug 08, 2012 at 01:31:34PM -0000, Javier Collado wrote:
> Javier Collado has proposed merging lp:~javier.collado/utah/static_analysis_4 into lp:utah/dev.
>
> Requested reviews:
> UTAH Dev (utah)
See my comments below. I'm pulling setUp and tearDown from tests/common. py into the tests namespace so that nosetests
utah/client/
will find them and run them on start and finish.
Joe /code.launchpad .net/~javier. collado/ utah/static_ analysis_ 4/+merge/ 118745 /code.launchpad .net/~javier. collado/ utah/static_ analysis_ 4/+merge/ 118745
>
> For more details, see:
> https:/
>
> One more round of static analysis changes
>
> Please have a look at the commit messages for further information about the problems fixed
> --
> https:/
> Your team UTAH Dev is requested to review the proposed merge of lp:~javier.collado/utah/static_analysis_4 into lp:utah/dev.
> === modified file 'examples/ run_install_ test.py' run_install_ test.py 2012-07-31 20:54:45 +0000 run_install_ test.py 2012-08-08 13:30:26 +0000 destroy( machine. machineid) write(' Failed to update inventory: ' + str(error)) write(' Failed to update inventory: ' run_test_ vm.py' run_test_ vm.py 2012-07-31 20:54:02 +0000 run_test_ vm.py 2012-08-08 13:30:26 +0000 destroy( machine. machineid) write(' Failed to update inventory: ' + str(error)) write(' Failed to update inventory: ' common. py' common. py 2012-08-02 18:36:14 +0000 common. py 2012-08-08 13:30:26 +0000 obj=None) : callbacks. artifact) ) result. py' result. py 2012-08-02 16:03:40 +0000 resul.. .
> --- examples/
> +++ examples/
> @@ -97,7 +97,8 @@
> try:
> inventory.
> except UTAHException as error:
> - sys.stderr.
> + sys.stderr.
> + + str(error))
> finally:
> del machine
> if len(locallogs) != 0:
>
> === modified file 'examples/
> --- examples/
> +++ examples/
> @@ -77,7 +77,8 @@
> try:
> inventory.
> except UTAHException as error:
> - sys.stderr.
> + sys.stderr.
> + + str(error))
> finally:
> del machine
> if len(locallogs) != 0:
>
> === modified file 'utah/client/
> --- utah/client/
> +++ utah/client/
> @@ -48,6 +48,7 @@
> CMD_TS_SETUP = 'testsuite_setup'
> CMD_TS_CLEANUP = 'testsuite_cleanup'
>
> +
> def do_nothing(
> """
> Do nothing method used a placeholder for save_state_
> @@ -265,6 +266,7 @@
> fp.close()
> print("### End {} ###".format(
>
> +
> def get_media_info():
> """
> Get the contents of the media-info file if available.
> @@ -279,6 +281,7 @@
>
> return media_info
>
> +
> def get_host_info():
> """
> Get host info, useful for debugging.
> @@ -291,6 +294,7 @@
>
> return retval
>
> +
> def get_api_config():
> """
> Parse the client configuration file for API configuration data.
> @@ -303,4 +307,3 @@
> data = json.load(fp)
>
> return data['API']
> -
>
> === modified file 'utah/client/
> --- utah/client/
> +++ utah/client/