'Adds an instance to the inventory and index, as long as it is
addressable'

def add_instance(self, instance, region):

    if (instance.state != 'running'):
        return
    if instance.subnet_id:
        dest = getattr(instance, self.vpc_destination_variable)
    else:
        dest = getattr(instance, self.destination_variable)
    if (not dest):
        return
    self.index[dest] = [region, instance.id]
    self.inventory[instance.id] = [dest]
    self.push(self.inventory, region, dest)
    self.push(self.inventory, instance.placement, dest)
    self.push(self.inventory, self.to_safe(('type_' + instance.instance_type)), dest)
    if instance.key_name:
        self.push(self.inventory, self.to_safe(('key_' + instance.key_name)), dest)
    try:
        for group in instance.groups:
            key = self.to_safe(('security_group_' + group.name))
            self.push(self.inventory, key, dest)
    except AttributeError:
        print 'Package    boto    seems    a    bit    older.'
        print 'Please    upgrade    boto    >=    2.3.0.'
        sys.exit(1)
    for (k, v) in instance.tags.iteritems():
        key = self.to_safe(((('tag_' + k) + '=') + v))
        self.push(self.inventory, key, dest)
        self.keep_first(self.inventory, ('first_in_' + key), dest)
    if self.route53_enabled:
        route53_names = self.get_instance_route53_names(instance)
        for name in route53_names:
            self.push(self.inventory, name, dest)
