Merge lp:~nuclearbob/utah/bug1047366 into lp:utah

Proposed by Max Brustkern
Status: Merged
Merged at revision: 686
Proposed branch: lp:~nuclearbob/utah/bug1047366
Merge into: lp:utah
Diff against target: 14 lines (+3/-1)
1 file modified
utah/provisioning/baremetal/cobbler.py (+3/-1)
To merge this branch: bzr merge lp:~nuclearbob/utah/bug1047366
Reviewer Review Type Date Requested Status
Joe Talbott (community) Approve
Review via email: mp+125315@code.launchpad.net

Description of the change

This branch checks the return code of cobbler commands. If the return code is nonzero, an error will be logged and an exception will be raised. Cobbler often exits with status 0 when a failure has occurred, but this should catch some issues.

To post a comment you must log in.
Revision history for this message
Joe Talbott (joetalbott) 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/provisioning/baremetal/cobbler.py'
2--- utah/provisioning/baremetal/cobbler.py 2012-08-30 08:34:34 +0000
3+++ utah/provisioning/baremetal/cobbler.py 2012-09-19 19:05:34 +0000
4@@ -172,7 +172,9 @@
5 Pull out all cobbler commands so that we can later support changing
6 users, remote login, not sudo, etc.
7 """
8- self._runargs(['sudo', 'cobbler'] + cmd)
9+ if self._runargs(['sudo', 'cobbler'] + cmd) != 0:
10+ self.logger.error('Cobbler command failed: ' + ' '.join(cmd))
11+ raise UTAHBMProvisioningException('Cobbler command failed: ' + ' '.join(cmd))
12
13 def _start(self):
14 """

Subscribers

People subscribed via source and target branches