Deal with hosting device removed RPC message.
488866
def hosting_devices_removed(self, context, payload):
        """"""
        try:
            if payload['hosting_data']:
                if payload['hosting_data'].keys():
                    self.process_services(removed_devices_info=payload)
        except KeyError as e:
            LOG.error("Invalid payload format for received RPC message "
                      "`hosting_devices_removed`. Error is %(error)s. Payload "
                      "is %(payload)s", {'error': e, 'payload': payload})
936911
function(){
    if (controller.connection.opts.requestProtocolVersion < 5 && controller.streamingCount == 0){
      controller.streamingCount = 1;
      var info = {
        attached: true,
        streaming: true,
        type: 'unknown',
        id: "Lx00000000000"
      };
      controller.devices[info.id] = info;

      controller.emit('deviceAttached', info);
      controller.emit('deviceStreaming', info);
      controller.emit('streamingStarted', info);
      controller.connection.removeListener('frame', backfillStreamingStartedEventsHandler)
    }
  }
1162230
def remove_service(self, zeroconf, srv_type, srv_name):
        """"""
        self.servers.remove_server(srv_name)
        logger.info(
            "Glances server %s removed from the autodetect list" % srv_name)
1282120
async def resolve(
        self, host, port=80, family=None, qtype='A', logging=True
    ):
        """"""
        if self.host_is_ip(host):
            return host

        _host = self._cached_hosts.get(host)
        if _host:
            return _host

        resp = await self._resolve(host, qtype)

        if resp:
            hosts = [
                {
                    'hostname': host,
                    'host': r.host,
                    'port': port,
                    'family': family,
                    'proto': socket.IPPROTO_IP,
                    'flags': socket.AI_NUMERICHOST,
                }
                for r in resp
            ]
            if family:
                self._cached_hosts[host] = hosts
            else:
                self._cached_hosts[host] = hosts[0]['host']
            if logging:
                log.debug(
                    '%s: Host resolved: %s' % (host, self._cached_hosts[host])
                )
        else:
            if logging:
                log.warning('%s: Could not resolve host' % host)
        return self._cached_hosts.get(host)
457779
def _delete_idle_service_vm_hosting_devices(self, context, num, template):
        
        # Delete the "youngest" hosting devices since they are more likely
        # not to have finished booting
        num_deleted = 0
        plugging_drv = self.get_hosting_device_plugging_driver(context,
                                                               template['id'])
        hosting_device_drv = self.get_hosting_device_driver(context,
                                                            template['id'])
        if plugging_drv is None or hosting_device_drv is None or num <= 0:
            return num_deleted
        query = context.session.query(hd_models.HostingDevice)
        query = query.outerjoin(
            hd_models.SlotAllocation,
            hd_models.HostingDevice.id ==
            hd_models.SlotAllocation.hosting_device_id)
        query = query.filter(hd_models.HostingDevice.template_id ==
                             template['id'],
                             hd_models.HostingDevice.admin_state_up ==
                             expr.true(),
                             hd_models.HostingDevice.tenant_bound ==
                             expr.null(),
                             hd_models.HostingDevice.auto_delete ==
                             expr.true())
        query = query.group_by(hd_models.HostingDevice.id).having(
            func.count(hd_models.SlotAllocation.logical_resource_id) == 0)
        query = query.order_by(
            hd_models.HostingDevice.created_at.desc(),
            func.count(hd_models.SlotAllocation.logical_resource_id))
        hd_candidates = query.all()
        num_possible_to_delete = min(len(hd_candidates), num)
        for i in range(num_possible_to_delete):
            res = plugging_drv.get_hosting_device_resources(
                context, hd_candidates[i]['id'],
                hd_candidates[i]['complementary_id'], self.l3_tenant_id(),
                self.mgmt_nw_id())
            if self.svc_vm_mgr.delete_service_vm(context,
                                                 hd_candidates[i]['id']):
                with context.session.begin(subtransactions=True):
                    context.session.delete(hd_candidates[i])
                plugging_drv.delete_hosting_device_resources(
                    context, self.l3_tenant_id(), **res)
                num_deleted += 1
        LOG.info('Deleted %(num)d hosting devices based on template '
                 '%(t_id)s', {'num': num_deleted, 't_id': template['id']})
        return num_deleted
1349070
function(connection, probeId, callback) {
      var t = this, proxy = connection.remoteProbesById[probeId];
      if (!proxy) {return callback('Probe not running');}
      if (--proxy.refCount === 0) {
        // Release probe resources
        proxy.release();
        proxy.connection = null;
        delete connection.remoteProbesById[probeId];
        delete connection.remoteProbeIdsByKey[proxy.probeKey];
        connection.removeEvent('probe:change:' + probeId);
        return connection.emit('probe:disconnect', {probeId:probeId}, function(error){
          return callback(error);
        });
      }
      callback(null);
    }
986941
def _delete_dead_service_vm_hosting_device(self, context, hosting_device):
        
        if hosting_device is None:
            return
        plugging_drv = self.get_hosting_device_plugging_driver(
            context, hosting_device['template_id'])
        hosting_device_drv = self.get_hosting_device_driver(
            context, hosting_device['template_id'])
        if plugging_drv is None or hosting_device_drv is None:
            return
        res = plugging_drv.get_hosting_device_resources(
            context, hosting_device['id'], hosting_device['complementary_id'],
            self.l3_tenant_id(), self.mgmt_nw_id())
        if not self.svc_vm_mgr.delete_service_vm(context,
                                                 hosting_device['id']):
            LOG.error('Failed to delete hosting device %s service VM. '
                      'Will un-register it anyway.',
                      hosting_device['id'])
        plugging_drv.delete_hosting_device_resources(
            context, self.l3_tenant_id(), **res)
        with context.session.begin(subtransactions=True):
            # remove all allocations in this hosting device
            context.session.query(hd_models.SlotAllocation).filter_by(
                hosting_device_id=hosting_device['id']).delete()
            context.session.delete(hosting_device)
869826
async def rpc_message(self, request, message):
        ''''''
        await self.pubsub.publish(self.channel, message)
        return 'OK'
30098
def _handle_reset(self):
        

        self._registered.clear()
        self._start_received.clear()
        self._hosted_app_running.clear()

        super(EmulatedPeripheralTile, self)._handle_reset()
701054
def remove_router_from_hosting_device(self, context, hosting_device_id,
                                          router_id):
        
        e_context = context.elevated()
        r_hd_binding_db = self._get_router_binding_info(e_context, router_id)
        if r_hd_binding_db.hosting_device_id != hosting_device_id:
            raise routertypeawarescheduler.RouterNotHostedByHostingDevice(
                router_id=router_id, hosting_device_id=hosting_device_id)
        router = self.get_router(context, router_id)
        self.add_type_and_hosting_device_info(
            e_context, router, r_hd_binding_db, schedule=False)
        # conditionally remove router from backlog ensure it does not get
        # scheduled automatically
        self.remove_router_from_backlog(id)
        l3_cfg_notifier = self.agent_notifiers.get(AGENT_TYPE_L3_CFG)
        if l3_cfg_notifier:
            l3_cfg_notifier.router_removed_from_hosting_device(context, router)
        LOG.debug("Unscheduling router %s", r_hd_binding_db.router_id)
        self.unschedule_router_from_hosting_device(context, r_hd_binding_db)
        # now unbind the router from the hosting device
        with e_context.session.begin(subtransactions=True):
            r_hd_binding_db.hosting_device_id = None
            e_context.session.add(r_hd_binding_db)
1282907
def disconnect(self, device):
        """"""
        self.device.ctrl.sendcontrol('d')
        self.device.ctrl.send("c.")
        self.log("CONSOLE SERVER disconnect")
        try:
            self.device.ctrl.send(chr(4))
        except OSError:
            self.log("Protocol already disconnected")
257559
def remove_device(self, request):
        """"""
        
        devices = self.__get_u2f_devices()

        for i in range(len(devices)):
            if devices[i]['keyHandle'] == request['id']:
                del devices[i]
                self.__save_u2f_devices(devices)
                
                return {
                    'status'  : 'ok', 
                    'message' : 'Successfully deleted your device!'
                }

        return {
            'status' : 'failed', 
            'error'  : 'No device with such an id been found!'
        }
1275013
def device_removed(self, device):
        """"""
        if not self._mounter.is_handleable(device):
            return
        device_file = device.device_presentation
        if (device.is_drive or device.is_toplevel) and device_file:
            self._show_notification(
                'device_removed',
                _('Device removed'),
                _('device disappeared on {0.device_presentation}', device),
                device.icon_name)
966170
private void unregisterRemoteCommands()
   {
      if (rpcService != null)
      {
         rpcService.unregisterCommand(suspend);
         rpcService.unregisterCommand(resume);
         rpcService.unregisterCommand(requestForResponsibleForResuming);
      }
      
   }
253517
def bmp_server_del(self, address, port):
        

        func_name = 'bmp.stop'
        param = {
            'host': address,
            'port': port,
        }

        call(func_name, **param)
1299878
def RemoveDevice(self, object_path):
    ''' '''

    adapter = mockobject.objects[self.path]
    adapter.EmitSignal(ADAPTER_IFACE, 'DeviceRemoved',
                       'o', [object_path])
84826
def remove(self):
        
        ''' 
                
        '''
        
        self.table.drop(self.engine)
        
        exit_msg = '%s table has been removed from %s database.' % (self.table_name, self.database_name)
        self.printer(exit_msg)
        
        return exit_msg