Example #1
0
 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
Example #2
0
 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
Example #3
0
    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
Example #4
0
    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
Example #5
0
    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