def sync(self, service):
        """Sync service defintion to device."""
        # loadbalancer and plugin_rpc may not be set
        lb_id = service.get('loadbalancer', dict()).get('id', '')
        if hasattr(self, 'plugin_rpc') and self.plugin_rpc and lb_id:
            # Get the latest service. It may have changed.
            service = self.plugin_rpc.get_service_by_loadbalancer_id(lb_id)
        if service.get('loadbalancer', None):
            self.lbaas_builder.to_sync = True
            self._common_service_handler(service)
            self.lbaas_builder.to_sync = False
            # pzhang(NOTE): move udpate neutron db out here for the lb tree
            if self.do_service_update:
                self.update_service_status(service)
            loadbalancer = service.get('loadbalancer', {})
            lb_provisioning_status = loadbalancer.get("provisioning_status",
                                                      f5const.F5_ERROR)
            lb_pending = \
                (lb_provisioning_status == f5const.F5_PENDING_CREATE or
                 lb_provisioning_status == f5const.F5_PENDING_UPDATE)
            return lb_pending
        else:
            LOG.debug("Attempted sync of deleted pool")