'Ensure that the safe_to_retire tag has been added to the instance in question
with the value \'true\''

def verify_ok_to_retire(self, instance_id):

    instance = self.get_ec2_instance_by_id(instance_id)
    if instance:
        if (('safe_to_retire' in instance.tags) and (instance.tags['safe_to_retire'].lower() == 'true')):
            logging.info('Instance    with    id    {id}    is    safe    to    retire.'.format(id=instance_id))
            return True
        else:
            logging.info('Instance    with    id    {id}    is    not    safe    to    retire.'.format(id=instance_id))
            return False
    else:
        message = 'Instance    with    id    {id}    is    referenced    in    an    SQS    message,    but    does    not    exist.'.format(id=instance_id)
        raise MissingHostError(message)
