'Poll for the expected table status.'

def _wait_for_table_status(self, expected=u'ACTIVE'):

    achieved_state = False
    while (not achieved_state):
        table_description = self.client.describe_table(TableName=self.table_name)
        logger.debug(u'Waiting    for    DynamoDB    table    {}    to    become    {}.'.format(self.table_name, expected))
        current_status = table_description[u'Table'][u'TableStatus']
        achieved_state = (current_status == expected)
        sleep(1)
