On Wed, Mar 20, 2013 at 01:57:11PM +0000, Ric Holland wrote:
On 20/03/13 13:06, Lars Wirzenius wrote:
>On Wed, Mar 20, 2013 at 01:05:02PM +0000, Jonathan Maw wrote:
>>On 2013-03-19 17:04, Richard Holland wrote:
>>>From: Ric Holland <richard.holland(a)codethink.co.uk>
>>>
>>>morph.log will now show an INFO message rther than a ERROR
>>>---
>>>morphlib/git.py | 2 +-
>>>1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>>diff --git a/morphlib/git.py b/morphlib/git.py
>>>index c491991..9cdd0a8 100644
>>>--- a/morphlib/git.py
>>>+++ b/morphlib/git.py
>>>@@ -80,7 +80,7 @@ class Submodules(object):
>>> # try to read the .gitmodules file from the repo/ref
>>> content = self.app.runcmd(
>>> ['git', 'cat-file', 'blob',
'%s:.gitmodules' %
>>>self.ref],
>>>- cwd=self.repo)
>>>+ cwd=self.repo, ignore_fail=True)
>>>
>>> # drop indentation in sections, as RawConfigParser
>>>cannot handle it
>>> return '\n'.join([line.strip() for line in
>>>content.splitlines()])
>>The changes to the code don't seem to reflect the description for
>>what it
>>does. According to Lars, ignore_fail will not show an INFO message
>>if it
>>fails, but rather completely ignore a failure.
>Yes, log_error=False is the right keyword argument.
>
Getting this in morph.log during a build using the branch:
"2013-03-20 13:52:58 INFO Command failed: git cat-file blob
fd07d4ce8a07adccd3ef355814a07788504ae71f:.gitmodules
fatal: Not a valid object name
fd07d4ce8a07adccd3ef355814a07788504ae71f:.gitmodules"
Is this not what was wanted?
Ah, yes, I see now where I was going wrong. You need ignore_errors=True
and log_error=True for the desired result. The latter is true by default,
and the patch correctly sets the former, so it should all be good.
--
http://www.codethink.co.uk/ http://wiki.baserock.org/ http://www.baserock.com/