Skip to content

Commit 7241394

Browse files
authored
change the format (sonic-net#50)
1 parent 3378ef8 commit 7241394

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

scripts/portstat

+14-5
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,20 @@ class Portstat(object):
162162
for key, data in cnstat_dict.iteritems():
163163
if key == 'time':
164164
continue
165-
table.append((key, self.get_port_status(key),
166-
data.rx_ok, "N/A", "N/A", "N/A", data.rx_err,
167-
data.rx_drop, data.rx_ovr,
168-
data.tx_ok, "N/A", "N/A", "N/A", data.tx_err,
169-
data.tx_drop, data.tx_ovr))
165+
166+
if print_all:
167+
table.append((key, self.get_port_status(key),
168+
data.rx_ok, "N/A", "N/A", "N/A", data.rx_err,
169+
data.rx_drop, data.rx_ovr,
170+
data.tx_ok, "N/A", "N/A", "N/A", data.tx_err,
171+
data.tx_drop, data.tx_ovr))
172+
else:
173+
table.append((key, self.get_port_status(key),
174+
data.rx_ok, "N/A", "N/A", data.rx_err,
175+
data.rx_drop, data.rx_ovr,
176+
data.tx_ok, "N/A", "N/A", data.tx_err,
177+
data.tx_drop, data.tx_ovr))
178+
170179

171180
if use_json:
172181
print self.table_as_json(table, print_all)

0 commit comments

Comments
 (0)