Browse Source

Properly update for Python 3.

Joe Clarke 4 years ago
parent
commit
fce38f37d2
1 changed files with 6 additions and 2 deletions
  1. 6 2
      automation/network/diff-route-tables.py

+ 6 - 2
automation/network/diff-route-tables.py

@@ -24,6 +24,10 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 
+from __future__ import print_function
+from future import standard_library
+
+standard_library.install_aliases()
 import paramiko
 import os
 from sparker import Sparker, MessageType
@@ -74,13 +78,13 @@ if __name__ == "__main__":
 
     do_push = False
 
-    for router, ip in routers.items():
+    for router, ip in list(routers.items()):
         try:
             ssh_client.connect(
                 ip, username=CLEUCreds.NET_USER, password=CLEUCreds.NET_PASS, timeout=60, allow_agent=False, look_for_keys=False,
             )
             chan = ssh_client.invoke_shell()
-            for fname, command in commands.items():
+            for fname, command in list(commands.items()):
                 output = ""
                 try:
                     chan.sendall("term length 0\n")