Added the interface and the stubbs to update the PM config for the
devices. Sample code for the simulated OLT and ponsim will be provided
in a subsequent update. Also deleted some commented out lines that were no longer
relevant to clean up the code a bit.
Change-Id: I8c7ba9a957ae2b7ba8ec816410bfb9ba01527625
diff --git a/voltha/adapters/broadcom_onu/broadcom_onu.py b/voltha/adapters/broadcom_onu/broadcom_onu.py
index 1854d32..3e96e1c 100644
--- a/voltha/adapters/broadcom_onu/broadcom_onu.py
+++ b/voltha/adapters/broadcom_onu/broadcom_onu.py
@@ -112,6 +112,9 @@
def get_device_details(self, device):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def update_flows_bulk(self, device, flows, groups):
log.info('bulk-flow-update', device_id=device.id,
flows=flows, groups=groups)
diff --git a/voltha/adapters/dpoe_onu/dpoe_onu.py b/voltha/adapters/dpoe_onu/dpoe_onu.py
index 89973aa..a73fd82 100644
--- a/voltha/adapters/dpoe_onu/dpoe_onu.py
+++ b/voltha/adapters/dpoe_onu/dpoe_onu.py
@@ -107,6 +107,9 @@
def change_master_state(self, master):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def adopt_device(self, device):
log.info('adopt-device', device=device)
reactor.callLater(0.1, self._onu_device_activation, device)
diff --git a/voltha/adapters/interface.py b/voltha/adapters/interface.py
index 9aef84f..24a4085 100644
--- a/voltha/adapters/interface.py
+++ b/voltha/adapters/interface.py
@@ -150,7 +150,7 @@
:return:
"""
- #def update_pm_collection(device, pm_collection_config):
+ def update_pm_config(device, pm_configs):
"""
Called every time a request is made to change pm collection behavior
:param device: A Voltha.Device object
diff --git a/voltha/adapters/maple_olt/maple_olt.py b/voltha/adapters/maple_olt/maple_olt.py
index 0b89967..3ec9ddc 100644
--- a/voltha/adapters/maple_olt/maple_olt.py
+++ b/voltha/adapters/maple_olt/maple_olt.py
@@ -222,6 +222,9 @@
def change_master_state(self, master):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def adopt_device(self, device):
self.devices_handlers[device.id] = MapleOltHandler(self, device.id)
reactor.callLater(0, self.devices_handlers[device.id].activate, device)
diff --git a/voltha/adapters/microsemi_olt/microsemi_olt.py b/voltha/adapters/microsemi_olt/microsemi_olt.py
index 152f8e3..addfd34 100644
--- a/voltha/adapters/microsemi_olt/microsemi_olt.py
+++ b/voltha/adapters/microsemi_olt/microsemi_olt.py
@@ -114,6 +114,9 @@
def reenable_device(self, device):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def reboot_device(self, device):
raise NotImplementedError()
diff --git a/voltha/adapters/pmcs_onu/pmcs_onu.py b/voltha/adapters/pmcs_onu/pmcs_onu.py
index 25796a8..8b244b6 100644
--- a/voltha/adapters/pmcs_onu/pmcs_onu.py
+++ b/voltha/adapters/pmcs_onu/pmcs_onu.py
@@ -100,6 +100,9 @@
def deactivate_device(self, device):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def update_flows_bulk(self, device, flows, groups):
log.info('bulk-flow-update', device_id=device.id,
flows=flows, groups=groups)
@@ -116,4 +119,4 @@
def receive_packet_out(self, logical_device_id, egress_port_no, msg):
log.info('packet-out', logical_device_id=logical_device_id,
- egress_port_no=egress_port_no, msg_len=len(msg))
\ No newline at end of file
+ egress_port_no=egress_port_no, msg_len=len(msg))
diff --git a/voltha/adapters/ponsim_olt/ponsim_olt.py b/voltha/adapters/ponsim_olt/ponsim_olt.py
index 08da855..3fed5c4 100644
--- a/voltha/adapters/ponsim_olt/ponsim_olt.py
+++ b/voltha/adapters/ponsim_olt/ponsim_olt.py
@@ -107,6 +107,9 @@
def change_master_state(self, master):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def adopt_device(self, device):
self.devices_handlers[device.id] = PonSimOltHandler(self, device.id)
reactor.callLater(0, self.devices_handlers[device.id].activate, device)
diff --git a/voltha/adapters/ponsim_onu/ponsim_onu.py b/voltha/adapters/ponsim_onu/ponsim_onu.py
index 36d0013..493145c 100644
--- a/voltha/adapters/ponsim_onu/ponsim_onu.py
+++ b/voltha/adapters/ponsim_onu/ponsim_onu.py
@@ -87,6 +87,9 @@
def change_master_state(self, master):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def adopt_device(self, device):
self.devices_handlers[device.id] = PonSimOnuHandler(self, device.id)
reactor.callLater(0, self.devices_handlers[device.id].activate, device)
diff --git a/voltha/adapters/simulated_olt/simulated_olt.py b/voltha/adapters/simulated_olt/simulated_olt.py
index 28ece21..5a05fc9 100644
--- a/voltha/adapters/simulated_olt/simulated_olt.py
+++ b/voltha/adapters/simulated_olt/simulated_olt.py
@@ -169,6 +169,9 @@
def get_device_details(self, device):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def _tmp_populate_stuff(self):
"""
pretend that we discovered some devices and create:
@@ -304,7 +307,6 @@
# first we pretend that we were able to contact the device and obtain
# additional information about it
- #log.info("device-activation")
device.root = True
device.vendor = 'simulated'
device.model = 'n/a'
@@ -313,11 +315,9 @@
device.software_version = '1.0'
device.serial_number = uuid4().hex
device.connect_status = ConnectStatus.REACHABLE
- #log.info("device-config",device=device)
device.pm_configs.default_freq=150
device.pm_configs.grouped = False
device.pm_configs.freq_override = False
- #log.info("device-config",device=device)
device.pm_configs.metrics.extend([PmConfig(name='tx_64',
type=PmConfig.COUNTER,
enabled=True)])
@@ -360,7 +360,6 @@
device.pm_configs.metrics.extend([PmConfig(name='rx_1519_9k',
type=PmConfig.COUNTER,
enabled=True)])
- #log.info("device-config",device=device)
self.adapter_agent.update_device(device)
# then shortly after we create some ports for the device
diff --git a/voltha/adapters/simulated_onu/simulated_onu.py b/voltha/adapters/simulated_onu/simulated_onu.py
index 9b45af5..e25004f 100644
--- a/voltha/adapters/simulated_onu/simulated_onu.py
+++ b/voltha/adapters/simulated_onu/simulated_onu.py
@@ -108,6 +108,9 @@
def get_device_details(self, device):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
@inlineCallbacks
def _simulate_device_activation(self, device):
diff --git a/voltha/adapters/tibit_olt/tibit_olt.py b/voltha/adapters/tibit_olt/tibit_olt.py
index 3bf9bfa..391f62b 100644
--- a/voltha/adapters/tibit_olt/tibit_olt.py
+++ b/voltha/adapters/tibit_olt/tibit_olt.py
@@ -145,6 +145,9 @@
def adapter_descriptor(self):
return self.descriptor
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def device_types(self):
return DeviceTypes(items=self.supported_device_types)
diff --git a/voltha/adapters/tibit_onu/tibit_onu.py b/voltha/adapters/tibit_onu/tibit_onu.py
index 33b7751..72a6f2a 100644
--- a/voltha/adapters/tibit_onu/tibit_onu.py
+++ b/voltha/adapters/tibit_onu/tibit_onu.py
@@ -109,6 +109,9 @@
def change_master_state(self, master):
raise NotImplementedError()
+ def update_pm_config(self, device, pm_configs):
+ raise NotImplementedError()
+
def adopt_device(self, device):
log.info('adopt-device', device=device)
reactor.callLater(0.1, self._onu_device_activation, device)
diff --git a/voltha/core/global_handler.py b/voltha/core/global_handler.py
index 03a443a..88ac4bd 100644
--- a/voltha/core/global_handler.py
+++ b/voltha/core/global_handler.py
@@ -369,10 +369,8 @@
request,
context)
- #TODO: create the global PM config query function
@twisted_async
def ListDevicePmConfigs(self, request, context):
- #raise NotImplementedError('Method not implemented!')
log.info('grpc-request', request=request)
try:
diff --git a/voltha/core/local_handler.py b/voltha/core/local_handler.py
index e494bd6..8466c4e 100644
--- a/voltha/core/local_handler.py
+++ b/voltha/core/local_handler.py
@@ -423,7 +423,6 @@
@twisted_async
def ListDevicePmConfigs(self, request, context):
- #raise NotImplementedError('Method not implemented!')
log.info('grpc-request', request=request)
if '/' in request.id: