Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright 2018 the original author or authors. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | """ |
| 18 | Openolt adapter. |
| 19 | """ |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 20 | from zope.interface import implementer |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 21 | import structlog |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 22 | |
| 23 | from openolt_device import OpenoltDevice |
| 24 | from voltha.adapters.interface import IAdapterInterface |
| 25 | from voltha.protos import third_party |
| 26 | from voltha.protos.adapter_pb2 import Adapter |
| 27 | from voltha.protos.adapter_pb2 import AdapterConfig |
| 28 | from voltha.protos.common_pb2 import LogLevel |
| 29 | from voltha.protos.device_pb2 import DeviceType, DeviceTypes |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 30 | from voltha.registry import registry |
| 31 | |
| 32 | _ = third_party |
| 33 | log = structlog.get_logger() |
| 34 | |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 35 | |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 36 | @implementer(IAdapterInterface) |
| 37 | class OpenoltAdapter(object): |
| 38 | name = 'openolt' |
| 39 | |
| 40 | supported_device_types = [ |
| 41 | DeviceType( |
| 42 | id=name, |
| 43 | adapter=name, |
| 44 | accepts_bulk_flow_update=True |
| 45 | ) |
| 46 | ] |
| 47 | |
| 48 | def __init__(self, adapter_agent, config): |
| 49 | self.adapter_agent = adapter_agent |
| 50 | self.config = config |
| 51 | self.descriptor = Adapter( |
| 52 | id=self.name, |
| 53 | vendor='OLT white box vendor', |
| 54 | version='0.1', |
| 55 | config=AdapterConfig(log_level=LogLevel.INFO) |
| 56 | ) |
| 57 | log.debug('openolt.__init__', adapter_agent=adapter_agent) |
| 58 | self.devices = dict() # device_id -> OpenoltDevice() |
| 59 | self.interface = registry('main').get_args().interface |
| 60 | self.logical_device_id_to_root_device_id = dict() |
Shad Ansari | 5dbc9c8 | 2018-05-10 03:29:31 +0000 | [diff] [blame] | 61 | self.num_devices = 0 |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 62 | |
| 63 | def start(self): |
| 64 | log.info('started', interface=self.interface) |
| 65 | |
| 66 | def stop(self): |
| 67 | log.info('stopped', interface=self.interface) |
| 68 | |
| 69 | def adapter_descriptor(self): |
| 70 | log.debug('get descriptor', interface=self.interface) |
| 71 | return self.descriptor |
| 72 | |
| 73 | def device_types(self): |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 74 | log.debug('get device_types', interface=self.interface, |
| 75 | items=self.supported_device_types) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 76 | return DeviceTypes(items=self.supported_device_types) |
| 77 | |
| 78 | def health(self): |
| 79 | log.debug('get health', interface=self.interface) |
| 80 | raise NotImplementedError() |
| 81 | |
| 82 | def change_master_state(self, master): |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 83 | log.debug('change_master_state', interface=self.interface, |
| 84 | master=master) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 85 | raise NotImplementedError() |
| 86 | |
| 87 | def adopt_device(self, device): |
| 88 | log.info('adopt-device', device=device) |
| 89 | kwargs = { |
| 90 | 'adapter_agent': self.adapter_agent, |
Shad Ansari | 5dbc9c8 | 2018-05-10 03:29:31 +0000 | [diff] [blame] | 91 | 'device': device, |
| 92 | 'device_num': self.num_devices + 1 |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 93 | } |
| 94 | try: |
| 95 | self.devices[device.id] = OpenoltDevice(**kwargs) |
| 96 | except Exception as e: |
| 97 | log.error('Failed to adopt OpenOLT device', error=e) |
| 98 | del self.devices[device.id] |
| 99 | raise |
Shad Ansari | 5dbc9c8 | 2018-05-10 03:29:31 +0000 | [diff] [blame] | 100 | else: |
| 101 | self.num_devices += 1 |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 102 | |
| 103 | def reconcile_device(self, device): |
| 104 | log.info('reconcile-device', device=device) |
Nicolas Palpacuer | 253461f | 2018-06-01 12:01:45 -0400 | [diff] [blame] | 105 | kwargs = { |
| 106 | 'adapter_agent': self.adapter_agent, |
| 107 | 'device': device, |
| 108 | 'device_num': self.num_devices + 1, |
| 109 | 'reconciliation': True |
| 110 | } |
| 111 | try: |
| 112 | reconciled_device = OpenoltDevice(**kwargs) |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 113 | log.debug('reconciled-device-recreated', |
| 114 | device_id=reconciled_device.device_id) |
Nicolas Palpacuer | 253461f | 2018-06-01 12:01:45 -0400 | [diff] [blame] | 115 | self.devices[device.id] = reconciled_device |
| 116 | except Exception as e: |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 117 | log.error('Failed to reconcile OpenOLT device', error=e, |
| 118 | exception_type=type(e).__name__) |
Nicolas Palpacuer | 253461f | 2018-06-01 12:01:45 -0400 | [diff] [blame] | 119 | del self.devices[device.id] |
| 120 | raise |
| 121 | else: |
| 122 | self.num_devices += 1 |
| 123 | # Invoke the children reconciliation which would setup the |
| 124 | # basic children data structures |
| 125 | self.adapter_agent.reconcile_child_devices(device.id) |
| 126 | return device |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 127 | |
| 128 | def abandon_device(self, device): |
| 129 | log.info('abandon-device', device=device) |
| 130 | raise NotImplementedError() |
| 131 | |
| 132 | def disable_device(self, device): |
| 133 | log.info('disable-device', device=device) |
Jonathan Davis | 0f917a2 | 2018-05-30 14:39:45 -0400 | [diff] [blame] | 134 | handler = self.devices[device.id] |
| 135 | handler.disable() |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 136 | |
| 137 | def reenable_device(self, device): |
| 138 | log.info('reenable-device', device=device) |
Jonathan Davis | 0f917a2 | 2018-05-30 14:39:45 -0400 | [diff] [blame] | 139 | handler = self.devices[device.id] |
| 140 | handler.reenable() |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 141 | |
| 142 | def reboot_device(self, device): |
| 143 | log.info('reboot_device', device=device) |
Nicolas Palpacuer | fd365ac | 2018-08-02 11:37:37 -0400 | [diff] [blame] | 144 | handler = self.devices[device.id] |
| 145 | handler.reboot() |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 146 | |
| 147 | def download_image(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 148 | log.info('image_download - Not implemented yet', device=device, |
| 149 | request=request) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 150 | raise NotImplementedError() |
| 151 | |
| 152 | def get_image_download_status(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 153 | log.info('get_image_download - Not implemented yet', device=device, |
| 154 | request=request) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 155 | raise NotImplementedError() |
| 156 | |
| 157 | def cancel_image_download(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 158 | log.info('cancel_image_download - Not implemented yet', device=device) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 159 | raise NotImplementedError() |
| 160 | |
| 161 | def activate_image_update(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 162 | log.info('activate_image_update - Not implemented yet', |
| 163 | device=device, request=request) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 164 | raise NotImplementedError() |
| 165 | |
| 166 | def revert_image_update(self, device, request): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 167 | log.info('revert_image_update - Not implemented yet', |
| 168 | device=device, request=request) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 169 | raise NotImplementedError() |
| 170 | |
| 171 | def self_test_device(self, device): |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 172 | # from voltha.protos.voltha_pb2 import SelfTestResponse |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 173 | log.info('Not implemented yet') |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 174 | raise NotImplementedError() |
| 175 | |
| 176 | def delete_device(self, device): |
| 177 | log.info('delete-device', device=device) |
Jonathan Davis | 0f917a2 | 2018-05-30 14:39:45 -0400 | [diff] [blame] | 178 | handler = self.devices[device.id] |
| 179 | handler.delete() |
| 180 | del self.devices[device.id] |
Nicolas Palpacuer | 0d44e68 | 2018-08-06 10:30:26 -0400 | [diff] [blame^] | 181 | return device |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 182 | |
| 183 | def get_device_details(self, device): |
| 184 | log.debug('get_device_details', device=device) |
| 185 | raise NotImplementedError() |
| 186 | |
| 187 | def update_flows_bulk(self, device, flows, groups): |
| 188 | log.info('bulk-flow-update', device_id=device.id, |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 189 | number_of_flows=len(flows.items), number_of_groups=len( |
| 190 | groups.items)) |
| 191 | log.debug('flows and grousp details', flows=flows, groups=groups) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 192 | assert len(groups.items) == 0, "Cannot yet deal with groups" |
| 193 | handler = self.devices[device.id] |
| 194 | return handler.update_flow_table(flows.items) |
| 195 | |
| 196 | def update_flows_incrementally(self, device, flow_changes, group_changes): |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 197 | log.debug('update_flows_incrementally', device=device, |
| 198 | flow_changes=flow_changes, group_changes=group_changes) |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 199 | log.info('This device does not allow this, therefore it is Not ' |
| 200 | 'implemented') |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 201 | raise NotImplementedError() |
| 202 | |
| 203 | def update_pm_config(self, device, pm_configs): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 204 | log.info('update_pm_config - Not implemented yet', device=device, |
| 205 | pm_configs=pm_configs) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 206 | raise NotImplementedError() |
| 207 | |
| 208 | def send_proxied_message(self, proxy_address, msg): |
| 209 | log.debug('send-proxied-message', proxy_address=proxy_address, msg=msg) |
| 210 | handler = self.devices[proxy_address.device_id] |
| 211 | handler.send_proxied_message(proxy_address, msg) |
| 212 | |
| 213 | def receive_proxied_message(self, proxy_address, msg): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 214 | log.debug('receive_proxied_message - Not implemented', |
| 215 | proxy_address=proxy_address, |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 216 | msg=msg) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 217 | raise NotImplementedError() |
| 218 | |
| 219 | def receive_packet_out(self, logical_device_id, egress_port_no, msg): |
| 220 | log.debug('packet-out', logical_device_id=logical_device_id, |
| 221 | egress_port_no=egress_port_no, msg_len=len(msg)) |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 222 | |
Shad Ansari | 42db734 | 2018-04-25 21:39:46 +0000 | [diff] [blame] | 223 | def ldi_to_di(ldi): |
| 224 | di = self.logical_device_id_to_root_device_id.get(ldi) |
| 225 | if di is None: |
| 226 | logical_device = self.adapter_agent.get_logical_device(ldi) |
| 227 | di = logical_device.root_device_id |
| 228 | self.logical_device_id_to_root_device_id[ldi] = di |
| 229 | return di |
| 230 | |
| 231 | device_id = ldi_to_di(logical_device_id) |
| 232 | handler = self.devices[device_id] |
| 233 | handler.packet_out(egress_port_no, msg) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 234 | |
| 235 | def receive_inter_adapter_message(self, msg): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 236 | log.info('rx_inter_adapter_msg - Not implemented') |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 237 | raise NotImplementedError() |
| 238 | |
| 239 | def suppress_alarm(self, filter): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 240 | log.info('suppress_alarm - Not implemented yet', filter=filter) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 241 | raise NotImplementedError() |
| 242 | |
| 243 | def unsuppress_alarm(self, filter): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 244 | log.info('unsuppress_alarm - Not implemented yet', filter=filter) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 245 | raise NotImplementedError() |
| 246 | |
| 247 | # PON Mgnt APIs # |
| 248 | def create_interface(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 249 | log.debug('create-interface - Not implemented - We do not use this', |
| 250 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 251 | raise NotImplementedError() |
| 252 | |
| 253 | def update_interface(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 254 | log.debug('update-interface - Not implemented - We do not use this', |
| 255 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 256 | raise NotImplementedError() |
| 257 | |
| 258 | def remove_interface(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 259 | log.debug('remove-interface - Not implemented - We do not use this', |
| 260 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 261 | raise NotImplementedError() |
| 262 | |
| 263 | def receive_onu_detect_state(self, proxy_address, state): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 264 | log.debug('receive-onu-detect-state - Not implemented - We do not ' |
| 265 | 'use this', proxy_address=proxy_address, |
Shad Ansari | f9d2d10 | 2018-06-13 02:15:26 +0000 | [diff] [blame] | 266 | state=state) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 267 | raise NotImplementedError() |
| 268 | |
| 269 | def create_tcont(self, device, tcont_data, traffic_descriptor_data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 270 | log.info('create-tcont - Not implemented - We do not use this', |
| 271 | tcont_data=tcont_data, |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 272 | traffic_descriptor_data=traffic_descriptor_data) |
| 273 | raise NotImplementedError() |
| 274 | |
| 275 | def update_tcont(self, device, tcont_data, traffic_descriptor_data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 276 | log.info('update-tcont - Not implemented - We do not use this', |
| 277 | tcont_data=tcont_data, |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 278 | traffic_descriptor_data=traffic_descriptor_data) |
| 279 | raise NotImplementedError() |
| 280 | |
| 281 | def remove_tcont(self, device, tcont_data, traffic_descriptor_data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 282 | log.info('remove-tcont - Not implemented - We do not use this', |
| 283 | tcont_data=tcont_data, |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 284 | traffic_descriptor_data=traffic_descriptor_data) |
| 285 | raise NotImplementedError() |
| 286 | |
| 287 | def create_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 288 | log.info('create-gemport - Not implemented - We do not use this', |
| 289 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 290 | raise NotImplementedError() |
| 291 | |
| 292 | def update_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 293 | log.info('update-gemport - Not implemented - We do not use this', |
| 294 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 295 | raise NotImplementedError() |
| 296 | |
| 297 | def remove_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 298 | log.info('remove-gemport - Not implemented - We do not use this', |
| 299 | data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 300 | raise NotImplementedError() |
| 301 | |
| 302 | def create_multicast_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 303 | log.info('create-mcast-gemport - Not implemented - We do not use ' |
| 304 | 'this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 305 | raise NotImplementedError() |
| 306 | |
| 307 | def update_multicast_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 308 | log.info('update-mcast-gemport - Not implemented - We do not use ' |
| 309 | 'this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 310 | raise NotImplementedError() |
| 311 | |
| 312 | def remove_multicast_gemport(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 313 | log.info('remove-mcast-gemport - Not implemented - We do not use ' |
| 314 | 'this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 315 | raise NotImplementedError() |
| 316 | |
| 317 | def create_multicast_distribution_set(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 318 | log.info('create-mcast-distribution-set - Not implemented - We do ' |
| 319 | 'not use this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 320 | raise NotImplementedError() |
| 321 | |
| 322 | def update_multicast_distribution_set(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 323 | log.info('update-mcast-distribution-set - Not implemented - We do ' |
| 324 | 'not use this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 325 | raise NotImplementedError() |
| 326 | |
| 327 | def remove_multicast_distribution_set(self, device, data): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 328 | log.info('remove-mcast-distribution-set - Not implemented - We do ' |
| 329 | 'not use this', data=data) |
Shad Ansari | 2825d01 | 2018-02-22 23:57:46 +0000 | [diff] [blame] | 330 | raise NotImplementedError() |
Jonathan Davis | b45bb37 | 2018-07-19 15:05:15 -0400 | [diff] [blame] | 331 | |
| 332 | def disable_child_device(self, parent_device_id, child_device): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 333 | log.info('disable-child_device', parent_device_id=parent_device_id, |
| 334 | child_device=child_device) |
Jonathan Davis | b45bb37 | 2018-07-19 15:05:15 -0400 | [diff] [blame] | 335 | handler = self.devices[parent_device_id] |
| 336 | handler.disable_child_device(child_device) |
| 337 | |
| 338 | def delete_child_device(self, parent_device_id, child_device): |
Nicolas Palpacuer | 324dcae | 2018-08-02 11:12:22 -0400 | [diff] [blame] | 339 | log.info('delete-child_device', parent_device_id=parent_device_id, |
| 340 | child_device=child_device) |
Jonathan Davis | b45bb37 | 2018-07-19 15:05:15 -0400 | [diff] [blame] | 341 | handler = self.devices[parent_device_id] |
| 342 | handler.delete_child_device(child_device) |