Merge lp:~javier.collado/utah/bug1101189 into lp:utah
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Javier Collado | ||||
Approved revision: | 803 | ||||
Merged at revision: | 804 | ||||
Proposed branch: | lp:~javier.collado/utah/bug1101189 | ||||
Merge into: | lp:utah | ||||
Diff against target: |
42 lines (+21/-10) 1 file modified
utah/provisioning/baremetal/cobbler.py (+21/-10) |
||||
To merge this branch: | bzr merge lp:~javier.collado/utah/bug1101189 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Joe Talbott (community) | Approve | ||
Review via email: mp+143890@code.launchpad.net |
Description of the change
This branch captures cobbler log using a `tail -f` subprocess against
`/var/log/
sure if it's worth to make it configurable). The subprocess output is read in a
finally clause, so it's executed whatever happens in the cobbler command
(exception raised or value returned).
An example using the python interpreter follows. Note that the command succeeds
in the shell (return code 0), but in the cobbler log there's an internal error.
This is the kind of problem that this merge is attempting to make easier to
detect:
m._cobble(
rovisioning.
DEBUG:root:Running command: sudo cobbler system add --name=a_name
DEBUG:root:Output follows:
DEBUG:root:
DEBUG:root:Return code: 0
DEBUG:root:Cobbler log follows:
Fri Jan 18 15:12:13 2013 - DEBUG | REMOTE CLI Authorized; user(?)
Fri Jan 18 15:12:13 2013 - DEBUG | get_item; ['system', 'a_name']
Fri Jan 18 15:12:13 2013 - DEBUG | done with get_item; ['system', 'a_name']
Fri Jan 18 15:12:13 2013 - INFO | Exception occured: <class 'cobbler.
Fri Jan 18 15:12:13 2013 - INFO | Exception value: 'internal error, unknown system name a_name'
Fri Jan 18 15:12:13 2013 - INFO | Exception Info:
File "/usr/lib/
handle = self.get_
File "/usr/lib/
raise CX("internal error, unknown %s name %s" % (what,name))
Fri Jan 18 15:12:13 2013 - INFO | REMOTE new_item(system); user(<DIRECT>)
Fri Jan 18 15:12:13 2013 - DEBUG | REMOTE CLI Authorized; user(?)
Fri Jan 18 15:12:13 2013 - INFO | REMOTE modify_
QUlDbzbVIAAQ==); attribute(in_place)
Fri Jan 18 15:12:13 2013 - DEBUG | REMOTE CLI Authorized; user(?)
Fri Jan 18 15:12:13 2013 - INFO | REMOTE modify_
QUlDbzbVIAAQ==); attribute(name)
Fri Jan 18 15:12:13 2013 - DEBUG | REMOTE CLI Authorized; user(?)
Fri Jan 18 15:12:13 2013 - INFO | REMOTE modify_
QUlDbzbVIAAQ==); attribute(
Fri Jan 18 15:12:13 2013 - DEBUG | REMOTE CLI Authorized; user(?)
Fri Jan 18 15:12:13 2013 - INFO | REMOTE save_item(system); user(<DIRECT>); object_
lDbzbVIAAQ==)
Fri Jan 18 15:12:13 2013 - DEBUG | REMOTE CLI Authorized; user(?)
Fri Jan 18 15:12:13 2013 - INFO | add_item(system); ['a_name']
Fri Jan 18 15:12:13 2013 - DEBUG | get_items; ['system']
Fri Jan 18 15:12:13 2013 - DEBUG | done with get_items; ['system']
This looks good to me.