VOL-1116 Openolt reboot
Change-Id: Ib84f2d2966e3cca4a39d508984277f07a073fabf
diff --git a/voltha/adapters/openolt/openolt.py b/voltha/adapters/openolt/openolt.py
index 3659baf..93be301 100644
--- a/voltha/adapters/openolt/openolt.py
+++ b/voltha/adapters/openolt/openolt.py
@@ -141,7 +141,8 @@
def reboot_device(self, device):
log.info('reboot_device', device=device)
- raise NotImplementedError()
+ handler = self.devices[device.id]
+ handler.reboot()
def download_image(self, device, request):
log.info('image_download', device=device, request=request)
diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index ce082dd..d4e67c3 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -953,3 +953,13 @@
onu_id=child_device.proxy_address.onu_id,
serial_number=serial_number)
self.stub.DeleteOnu(onu)
+
+ def reboot(self):
+ self.log.debug('rebooting openolt device', device_id = self.device_id)
+ try:
+ self.stub.Reboot(openolt_pb2.Empty())
+ except Exception as e:
+ self.log.error('something went wrong with the reboot', error=e)
+ else:
+ self.log.info('device rebooted')
+
diff --git a/voltha/adapters/openolt/protos/openolt.proto b/voltha/adapters/openolt/protos/openolt.proto
index 87515f9..bc9e953 100644
--- a/voltha/adapters/openolt/protos/openolt.proto
+++ b/voltha/adapters/openolt/protos/openolt.proto
@@ -88,6 +88,13 @@
};
}
+ rpc Reboot(Empty) returns (Empty) {
+ option (google.api.http) = {
+ post: "/v1/Reboot"
+ body: "*"
+ };
+ }
+
rpc EnableIndication(Empty) returns (stream Indication) {}
}