def reconcile_device(self, device): log.info('reconcile-device', device=device) kwargs = { 'adapter_agent': self.adapter_agent, 'device': device, 'device_num': self.num_devices + 1, 'reconciliation': True } try: reconciled_device = OpenoltDevice(**kwargs) log.debug('reconciled-device-recreated', device_id=reconciled_device.device_id) self.devices[device.id] = reconciled_device except Exception as e: log.error('Failed to reconcile OpenOLT device', error=e, exception_type=type(e).__name__) del self.devices[device.id] raise else: self.num_devices += 1 # Invoke the children reconciliation which would setup the # basic children data structures self.adapter_agent.reconcile_child_devices(device.id) return device
def adopt_device(self, device): log.info('adopt-device', device=device) kwargs = {'adapter_agent': self.adapter_agent, 'device': device} try: self.devices[device.id] = OpenoltDevice(**kwargs) except Exception as e: log.error('Failed to adopt OpenOLT device', error=e) del self.devices[device.id] raise
def adopt_device(self, device): log.info('adopt-device', device=device) kwargs = { 'support_classes': OpenOltDefaults['support_classes'], 'adapter_agent': self.adapter_agent, 'device': device, 'device_num': self.num_devices + 1 } try: self.devices[device.id] = OpenoltDevice(**kwargs) except Exception as e: log.error('Failed to adopt OpenOLT device', error=e) del self.devices[device.id] raise else: self.num_devices += 1
def adopt_device(self, device): log.info('adopt-device', device=device) kwargs = { 'adapter_agent': self.adapter_agent, 'device_id': device.id, 'host_and_port': device.host_and_port, 'extra_args': device.extra_args } try: self.devices[device.id] = OpenoltDevice(**kwargs) except Exception as e: log.error('Failed to adopt OpenOLT device', error=e) # TODO set status to ERROR so that is clear something went wrong del self.devices[device.id] raise else: self.num_devices += 1
def adopt_device(self, device): log.info('adopt-device', device=device) kwargs = { 'support_classes': OpenOltDefaults['support_classes'], 'adapter_agent': self.adapter_agent, 'device': device, 'device_num': self.num_devices + 1 } try: self.devices[device.id] = OpenoltDevice(**kwargs) except Exception as e: log.error('Failed to adopt OpenOLT device', error=e) # TODO set status to ERROR so that is clear something went wrong del self.devices[device.id] raise else: self.num_devices += 1