def check_backlogged_hosting_devices(self):
        response_dict = {'reachable': [], 'revived': [], 'dead': []}
        LOG.debug("Current Backlogged hosting devices: \n%s\n",
                  self.backlog_hosting_devices.keys())
        for hd_id in self.backlog_hosting_devices.keys():
            hd = self.backlog_hosting_devices[hd_id]['hd']
            if not timeutils.is_older_than(hd['created_at'],
                                           hd['booting_time']):
                LOG.info(_LI("Hosting device: %(hd_id)s @ %(ip)s hasn't "
                             "passed minimum boot time. Skipping it. "),
                         {'hd_id': hd_id, 'ip': hd['management_ip_address']})
                continue
            LOG.info(_LI("Checking hosting device: %(hd_id)s @ %(ip)s for "
                         "reachability."), {'hd_id': hd_id,
                                            'ip': hd['management_ip_address']})
            hd_state = hd['hd_state']
            if _is_pingable(hd['management_ip_address']):
                if hd_state == 'Unknown':
                    LOG.debug("hosting devices revived & reachable, %s" %
                              (pprint.pformat(hd)))
                    hd['hd_state'] = 'Active'
                    response_dict['revived'].append(hd_id)
                    # Rely just on full-sync to ensure consistent
                    # hosting device state
                    response_dict['reachable'].append(hd_id)
                elif hd_state == 'Dead':
                    LOG.debug("Dead hosting devices revived %s" %
                              (pprint.pformat(hd)))
                    hd['hd_state'] = 'Active'
                    response_dict['revived'].append(hd_id)
                else:
                    LOG.debug("No-op."
                              "_is_pingable is True and current"
                              " hd['hd_state']=%s" % (hd_state))

                LOG.info(_LI("Hosting device: %(hd_id)s @ %(ip)s is now "
                             "reachable. Adding it to response"),
                         {'hd_id': hd_id, 'ip': hd['management_ip_address']})
            else:
                LOG.info(_LI("Hosting device: %(hd_id)s %(hd_state)s"
                             " @ %(ip)s not reachable "),
                         {'hd_id': hd_id,
                          'hd_state': hd['hd_state'],
                          'ip': hd['management_ip_address']})
                if hd_state == 'Active':
                    LOG.debug("hosting device lost connectivity, %s" %
                              (pprint.pformat(hd)))
                    hd['backlog_insertion_ts'] = timeutils.utcnow()
                    hd['hd_state'] = 'Unknown'

                elif hd_state == 'Unknown':
                    if timeutils.is_older_than(
                            hd['backlog_insertion_ts'],
                            cfg.CONF.cfg_agent.hosting_device_dead_timeout):
                        # current hd_state is now dead, previous state: Unknown
                        hd['hd_state'] = 'Dead'
                        LOG.debug("Hosting device: %(hd_id)s @ %(ip)s hasn't "
                                  "been reachable for the "
                                  "last %(time)d seconds. "
                                  "Marking it dead.",
                                  {'hd_id': hd_id,
                                   'ip': hd['management_ip_address'],
                                   'time': cfg.CONF.cfg_agent.
                                   hosting_device_dead_timeout})
                        response_dict['dead'].append(hd_id)
        LOG.debug("Response: %s", response_dict)
        return response_dict
Command execution.
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/cisco/cfg_agent/device_status.py/DeviceStatus.check_backlogged_hosting_devices--crossover with--dataset/ETHPy150Open deschler/django-modeltranslation/modeltranslation/management/commands/sync_translation_fields.py/Command.handle