def c_table(TableName, **kwargs): # handles the creation of a tabale with error checking
# kwargs optionally passes in BOTO3 sessions for multithreading
try:
db_r.create_table(**t_conf(TableName))
print "INFO :: Waiting for Table [%s] to complete..." % TableName
db_r.Table(TableName).wait_until_exists()
except botocore.exceptions.ClientError as e:
if e.response['Error']['Code'] == "ResourceInUseException":
db_r.Table(TableName).delete()
print "INFO :: Learning Online %s Table exists, waiting for delete ...." % TableName
db_r.Table(TableName).wait_until_not_exists()
c_table(TableName)
else:
raise
#------------------------------------------------------------------------------
评论列表
文章目录