'Register or deregister instances from an lb instance'

def _set_instance_ids(self):

    assert_instances = (self.instance_ids or [])
    has_instances = self._get_instance_ids()
    add_instances = self._diff_list(assert_instances, has_instances)
    if add_instances:
        self.elb_conn.register_instances(self.elb.name, add_instances)
        self.changed = True
    if self.purge_instance_ids:
        remove_instances = self._diff_list(has_instances, assert_instances)
        if remove_instances:
            self.elb_conn.deregister_instances(self.elb.name, remove_instances)
            self.changed = True
