Skip to content

Commit

Permalink
Merge pull request #177 from jathanism/issue-177
Browse files Browse the repository at this point in the history
run_cmds shouldn't hide error messages (such as command timeouts)
  • Loading branch information
jathanism committed Apr 14, 2015
2 parents 80b5198 + dd65bdf commit dc964f1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions trigger/contrib/docommand/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__maintainer__ = 'Jathan McCollum'
__email__ = 'jathan@gmail.com'
__copyright__ = 'Copyright 2012-2013, AOL Inc.; 2013 Salesforce.com'
__version__ = '3.1'
__version__ = '3.2'


# Imports
Expand Down Expand Up @@ -41,11 +41,17 @@ class DoCommandBase(Commando):
"""
description = 'Insert description here.'

def errback(self, failure, device):
failure = super(DoCommandBase, self).errback(failure, device)
print '%s - Error: %s' % (device, failure.value)
return failure

def from_base(self, results, device, commands=None):
"""Call store_results without calling map_results"""
log.msg('Received %r from %s' % (results, device))
self.store_results(device, results)


# TODO: Right now if you are loading commands from files, this will ultimately
# fail with a ReactorNotRestartable error because the core.main() function is
# calling each action class separately. We need to account for this. See
Expand Down Expand Up @@ -161,6 +167,7 @@ def from_juniper(self, data, device, commands=None):
self.data[devname] = outs
return True


class ConfigLoader(Commando):
"""
Load configuration changes on network devices.
Expand Down Expand Up @@ -355,4 +362,3 @@ def xml_print(xml, iterations=10):
# Show elements in a tag1 -> tag2 -> tag3 -> field:value format
#ret.append(tag+" -> "+t)
return ret

0 comments on commit dc964f1

Please sign in to comment.