New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commando sometimes lists "None" as command in results #168

Closed
jathanism opened this Issue Mar 24, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@jathanism
Member

jathanism commented Mar 24, 2014

This also means, if multiple commands are passed, the results of a single command are returned and there is no indication on which command result is returned.

>>> from trigger.cmds import Commando
>>> class RandomCmds(Commando):
...     vendors=['cisco', 'juniper']
...     def to_cisco(self, device, commands=None, extra=None):
...             cmd = 'show version'
...             return [cmd]
...     def to_juniper(self, device, commands=None, extra=None):
...             return ['show version', 'show system uptime']
... 
>>> device_list = ['edge1-foo.net.example.com', 'bb2-foo.net.example.com']
>>> randomcmds = RandomCmds(devices=device_list, force_cli=True)
>>> randomcmds.run()
>>> randomcmds.results
{'edge1-sfm.ops.sfdc.net': {None: '<output here>',
 'bb2-foo.net.example.com': {None: '<other output>'}

@jathanism jathanism added the bug label Mar 24, 2014

@jathanism

This comment has been minimized.

Member

jathanism commented Feb 4, 2015

It looks like we may have confirmed that this happens in some cases where you define a to_{vendor} but not a from_{vendor}?

See this:
http://codepad.org/N6p6lJ4y

Which apparently can encounter the bug 100% of the time.

jathanism added a commit to jathanism/trigger that referenced this issue Apr 10, 2015

Fix trigger#168 for when Commando sometimes lists "None" as command i…
…n results.

+ Pep8 cleanup, too. This isn't done yet, tho!

@jathanism jathanism closed this in ed1b6b3 Apr 11, 2015

jathanism added a commit that referenced this issue Apr 11, 2015

Merge pull request #209 from jathanism/issue-168
Fix #168 for when Commando sometimes lists "None" as command in results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment