Skip to content

Commit

Permalink
Merge pull request trigger#251 from jathanism/gnng-fix
Browse files Browse the repository at this point in the history
Fixes trigger#250 - Bugfix to bin/gnng that would crash on -c or -s output.
  • Loading branch information
johnfzc committed Feb 25, 2016
2 parents 3978b8b + 6ec4747 commit b334b70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bin/gnng
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ devices.

__author__ = 'Jathan McCollum, Mark Ellzey Thomas'
__maintainer__ = 'Jathan McCollum'
__email__ = 'jmccollum@salesforce.com'
__email__ = 'jathan@gmail.com'
__copyright__ = 'Copyright 2003-2013, AOL Inc.; 2013 Salesforce.com'
__version__ = '1.3.1'
__version__ = '1.3.2'

from collections import namedtuple
import csv
Expand Down Expand Up @@ -293,7 +293,8 @@ def build_output(main_data, opts, labels=None):
labels = ROW_LABELS

subnet_table = {}
all_rows = []
all_rows = {}

for dev, data in main_data.iteritems():
rows = []
if not opts.csv and not opts.dotty:
Expand Down Expand Up @@ -344,7 +345,7 @@ def build_output(main_data, opts, labels=None):
rows.append([interface, ' '.join(addresses),
' '.join(subnets), '\n'.join(acls_in), '\n'.join(acls_out), desctext])

all_rows.append(rows)
all_rows[dev.nodeName] = rows

return RowData(all_rows, subnet_table)

Expand All @@ -358,7 +359,7 @@ def handle_output(all_rows, opts):
:param opts:
OptionParser object
"""
for rows in all_rows:
for dev, rows in all_rows.iteritems():

if opts.csv:
writer = csv.writer(sys.stdout)
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Bug Fixes

+ Bugfix in `~trigger.contrib.commando.plugins.config_device` causing an
unhandled ``NameError``.
+ :bug:`250` Bugfix in ``bin/gnng`` that would cause a crash when using
``--sqldb`` or ``--csv`` output flags.

.. _v1.5.6:

Expand Down

0 comments on commit b334b70

Please sign in to comment.