55import os
66import shutil
77import threading
8-
98import boto .dynamodb2 .layer1
109import datetime
1110import errno
@@ -101,7 +100,7 @@ def delete_table(conn, sleep_interval, table_name):
101100 table_exist = True
102101 try :
103102 conn .delete_table (table_name )
104- except boto .exception .JSONResponseError , e :
103+ except boto .exception .JSONResponseError as e :
105104 if e .body ["__type" ] == "com.amazonaws.dynamodb.v20120810#ResourceNotFoundException" :
106105 table_exist = False
107106 logging .info (table_name + " table deleted!" )
@@ -126,7 +125,7 @@ def delete_table(conn, sleep_interval, table_name):
126125 logging .info ("Waiting for " + table_name + " table to be deleted.. [" +
127126 conn .describe_table (table_name )["Table" ]["TableStatus" ] + "]" )
128127 time .sleep (sleep_interval )
129- except boto .exception .JSONResponseError , e :
128+ except boto .exception .JSONResponseError as e :
130129 if e .body ["__type" ] == "com.amazonaws.dynamodb.v20120810#ResourceNotFoundException" :
131130 logging .info (table_name + " table deleted." )
132131 pass
@@ -186,7 +185,7 @@ def update_provisioned_throughput(conn, table_name, read_capacity, write_capacit
186185 conn .update_table (table_name ,
187186 {"ReadCapacityUnits" : int (read_capacity ), "WriteCapacityUnits" : int (write_capacity )})
188187 break
189- except boto .exception .JSONResponseError , e :
188+ except boto .exception .JSONResponseError as e :
190189 if e .body ["__type" ] == "com.amazonaws.dynamodb.v20120810#LimitExceededException" :
191190 logging .info ("Limit exceeded, retrying updating throughput of " + table_name + ".." )
192191 time .sleep (sleep_interval )
@@ -228,7 +227,7 @@ def do_empty(conn, table_name):
228227 conn .create_table (table_attribute_definitions , table_name , table_key_schema , table_provisioned_throughput ,
229228 table_local_secondary_indexes , table_global_secondary_indexes )
230229 break
231- except boto .exception .JSONResponseError , e :
230+ except boto .exception .JSONResponseError as e :
232231 if e .body ["__type" ] == "com.amazonaws.dynamodb.v20120810#LimitExceededException" :
233232 logging .info ("Limit exceeded, retrying creation of " + table_name + ".." )
234233 time .sleep (sleep_interval )
@@ -350,7 +349,7 @@ def do_restore(conn, sleep_interval, source_table, destination_table, write_capa
350349 table_provisioned_throughput , table_local_secondary_indexes ,
351350 table_global_secondary_indexes )
352351 break
353- except boto .exception .JSONResponseError , e :
352+ except boto .exception .JSONResponseError as e :
354353 if e .body ["__type" ] == "com.amazonaws.dynamodb.v20120810#LimitExceededException" :
355354 logging .info ("Limit exceeded, retrying creation of " + destination_table + ".." )
356355 time .sleep (sleep_interval )
@@ -413,7 +412,7 @@ def do_restore(conn, sleep_interval, source_table, destination_table, write_capa
413412 try :
414413 conn .update_table (destination_table , global_secondary_index_updates = gsi_data )
415414 break
416- except boto .exception .JSONResponseError , e :
415+ except boto .exception .JSONResponseError as e :
417416 if e .body ["__type" ] == "com.amazonaws.dynamodb.v20120810#LimitExceededException" :
418417 logging .info (
419418 "Limit exceeded, retrying updating throughput of GlobalSecondaryIndexes in " + destination_table + ".." )
0 commit comments