Fix string formatting in log statement
Use newer xos-core with fixed kafkaloghandler
Change-Id: I532910d4aad0dc5142f54451fd7769220fcb1340
diff --git a/xos/synchronizer/models/convenience/voltservice.py b/xos/synchronizer/models/convenience/voltservice.py
index 032aabd..22f4188 100644
--- a/xos/synchronizer/models/convenience/voltservice.py
+++ b/xos/synchronizer/models/convenience/voltservice.py
@@ -1,4 +1,3 @@
-
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,17 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
from xosapi.orm import ORMWrapper, register_convenience_wrapper
from xosapi.convenience.service import ORMWrapperService
import logging as log
+
class ORMWrapperVOLTService(ORMWrapperService):
def get_onu_sn_from_openflow(self, dp_id, port_no):
"""Return the ONU serial number from logical_device informations
-
+
example usage:
volt = VOLTService.objects.first()
sn = volt.get_onu_from_openflow("of:0000000ce2314000", 2)
@@ -32,21 +31,21 @@
Arguments:
dp_id {string} -- The openflow id of the OLT device
port_no {int} -- The openflow port id (UNI Port)
-
+
Returns:
string -- ONU Serial Number
"""
- log.debug("Searching ONUDevice for %s:%s", (dp_id, port_no))
- print "Searching ONUDevice for %s:%s", (dp_id, port_no)
+ log.debug("Searching ONUDevice for %s:%s" % (dp_id, port_no))
try:
olt = self.stub.OLTDevice.objects.get(dp_id=dp_id)
uni_ports = self.stub.UNIPort.objects.filter(port_no=port_no)
onu = [o.onu_device for o in uni_ports if o.onu_device.pon_port.olt_device.id == olt.id][0]
return onu.serial_number
except IndexError:
- log.error("Can't find ONU for %s:%s", (dp_id, port_no))
+ log.error("Can't find ONU for %s:%s" % (dp_id, port_no))
except Exception:
- log.exception("Error while finding ONUDevice for %s:%s", (dp_id, port_no))
+ log.exception("Error while finding ONUDevice for %s:%s" % (dp_id, port_no))
-register_convenience_wrapper("VOLTService", ORMWrapperVOLTService)
\ No newline at end of file
+
+register_convenience_wrapper("VOLTService", ORMWrapperVOLTService)