Skip to content

Commit 80548cc

Browse files
Fixed the random output of 'rollback 0' on Juniper devices
1 parent 0a3c091 commit 80548cc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

auditdiff_engine.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def juniper_audit_diff(directory,template,template_list,diff_config,edit_list,se
369369

370370
index_of_template_list = template_list.index(template) + 1
371371

372-
# print("EDIT_LIST: {}".format(edit_list))
372+
print("EDIT_LIST: {}".format(edit_list))
373373

374374
### THIS WILL CHECK IF IT'S ON THE LAST TEMPLATE. IF IT IS, IT WILL LOCATE THE LAST INDEX FOR EDIT_LIST AND APPEND IT TO THE LIST
375375
if(index_of_template_list == length_template_list):
@@ -409,7 +409,11 @@ def juniper_audit_diff(directory,template,template_list,diff_config,edit_list,se
409409
###UN-COMMENT THE BELOW PRINT STATEMENT FOR DEBUGING PURPOSES
410410
# print "DIFF_TEMPLATE: {}".format(diff_template)
411411
for line in diff_template:
412-
print("{}".format(line))
412+
## THE BELOW IF STATEMENT IS TO CORRECT THE OUTPUT. AT RANDOM TIMES, THE DIFF-CONFIG MAY INCLUDE 'ROLLBACK 0' IN OUTPUT. IT WILL OMIT PRINTING THAT.
413+
if line == 'rollback 0':
414+
pass
415+
else:
416+
print("{}".format(line))
413417
print
414418
else:
415419
continue

0 commit comments

Comments
 (0)