This commit consists of:
1) Update the existing tests to use enable instead of activate
2) Add the required interface methods to pmcs
3) Update the voltha.proto to have the correct delete method
4) Comment out some code in config_node to prevent an additional
item to be queued on the main branch. This new item was preventing
any device updates (assert failed because that item was queued but
not consumed). Further debugging would be required before that code
can be reintegrated.
Change-Id: I4fa75ea6531f496a8cf8233f2e78c0076c3b23a1
diff --git a/cli/main.py b/cli/main.py
index 3d9de58..05cee3b 100755
--- a/cli/main.py
+++ b/cli/main.py
@@ -284,7 +284,7 @@
pre-provisioned device.
"""
device_id = line or self.default_device_id
- self.poutput('activating {}'.format(device_id))
+ self.poutput('enabling {}'.format(device_id))
stub = voltha_pb2.VolthaLocalServiceStub(self.get_channel())
stub.EnableDevice(voltha_pb2.ID(id=device_id))
diff --git a/tests/itests/voltha/test_cold_activation_sequence.py b/tests/itests/voltha/test_cold_activation_sequence.py
index ba49e24..64c405c 100644
--- a/tests/itests/voltha/test_cold_activation_sequence.py
+++ b/tests/itests/voltha/test_cold_activation_sequence.py
@@ -66,7 +66,7 @@
def activate_device(self, olt_id):
path = '/api/v1/devices/{}'.format(olt_id)
- self.post(path + '/activate', expected_code=200)
+ self.post(path + '/enable', expected_code=200)
device = self.get(path)
self.assertEqual(device['admin_state'], 'ENABLED')
diff --git a/voltha/adapters/pmcs_onu/pmcs_onu.py b/voltha/adapters/pmcs_onu/pmcs_onu.py
index 3e5149a..25796a8 100644
--- a/voltha/adapters/pmcs_onu/pmcs_onu.py
+++ b/voltha/adapters/pmcs_onu/pmcs_onu.py
@@ -82,6 +82,21 @@
def abandon_device(self, device):
raise NotImplementedError()
+ def disable_device(self, device):
+ raise NotImplementedError()
+
+ def reenable_device(self, device):
+ raise NotImplementedError()
+
+ def reboot_device(self, device):
+ raise NotImplementedError()
+
+ def delete_device(self, device):
+ raise NotImplementedError()
+
+ def get_device_details(self, device):
+ raise NotImplementedError()
+
def deactivate_device(self, device):
raise NotImplementedError()
diff --git a/voltha/core/config/config_node.py b/voltha/core/config/config_node.py
index 4e1023b..f679786 100644
--- a/voltha/core/config/config_node.py
+++ b/voltha/core/config/config_node.py
@@ -305,13 +305,17 @@
)
- for change_type, data in change_announcements:
- self._root.enqueue_callback(
- self._mk_event_bus().advertise,
- change_type,
- data,
- hash=rev.hash
- )
+ # TODO: This fix needs to be investigated/reworked as it causes an
+ # extra item to be queued in the main branch. This item does
+ # not get consumed, hence preventing any device update on the
+ # main branch
+ # for change_type, data in change_announcements:
+ # self._root.enqueue_callback(
+ # self._mk_event_bus().advertise,
+ # change_type,
+ # data,
+ # hash=rev.hash
+ # )
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ add operation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/voltha/protos/voltha.proto b/voltha/protos/voltha.proto
index 911dfb8..89d379e 100644
--- a/voltha/protos/voltha.proto
+++ b/voltha/protos/voltha.proto
@@ -444,7 +444,7 @@
// Delete a device
rpc DeleteDevice(ID) returns(google.protobuf.Empty) {
option (google.api.http) = {
- post: "/api/v1/local/devices/{id}/delete"
+ delete: "/api/v1/local/devices/{id}/delete"
};
}