Skip to content

Commit

Permalink
Merge branch 'bug2122' of git://github.com/tomprince/buildbot
Browse files Browse the repository at this point in the history
* 'bug2122' of git://github.com/tomprince/buildbot:
  ShellCommand.describe(): Ignore AttributeError

Conflicts:
	master/buildbot/steps/shell.py
  • Loading branch information
djmitche committed Jan 20, 2012
2 parents d254746 + e92aec4 commit d4cedf8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions master/buildbot/steps/shell.py
Expand Up @@ -179,6 +179,12 @@ def describe(self, done=False):
if isinstance(words, (str, unicode)):
words = words.split()

try:
len(words)
except AttributeError:
# WithProperties and Property don't have __len__
return ["???"]

tmp = []
for x in words:
if isinstance(x, (str, unicode)):
Expand Down
6 changes: 6 additions & 0 deletions master/buildbot/test/unit/test_steps_shell.py
Expand Up @@ -23,6 +23,7 @@
from buildbot.test.fake.remotecommand import ExpectShell, Expect
from buildbot.test.fake.remotecommand import ExpectRemoteRef
from buildbot import config
from buildbot.process import properties

class TestShellCommandExecution(steps.BuildStepMixin, unittest.TestCase):

Expand Down Expand Up @@ -128,6 +129,11 @@ def test_describe_custom(self):
self.assertEqual((step.describe(), step.describe(done=True)),
(['echoing'], ['echoed']))

def test_describe_unrendered_WithProperties(self):
step = shell.ShellCommand(command=properties.WithProperties(''))
self.assertEqual((step.describe(), step.describe(done=True)),
(['???'],)*2)

@compat.usesFlushLoggedErrors
def test_describe_fail(self):
step = shell.ShellCommand(command=object())
Expand Down

0 comments on commit d4cedf8

Please sign in to comment.