'Determine which subnets need to be attached or detached on the ELB'

def _set_subnets(self):

    if self.subnets:
        if self.purge_subnets:
            subnets_to_detach = list((set(self.elb.subnets) - set(self.subnets)))
            subnets_to_attach = list((set(self.subnets) - set(self.elb.subnets)))
        else:
            subnets_to_detach = None
            subnets_to_attach = list((set(self.subnets) - set(self.elb.subnets)))
        if subnets_to_attach:
            self._attach_subnets(subnets_to_attach)
        if subnets_to_detach:
            self._detach_subnets(subnets_to_detach)
