Fixing proto imports
Change-Id: Ia1b353533a62198c43fe3c3b55c678898512a78b
diff --git a/voltha/adapters/microsemi/RubyAdapter.py b/voltha/adapters/microsemi/RubyAdapter.py
index b06c2e0..f12cbed 100644
--- a/voltha/adapters/microsemi/RubyAdapter.py
+++ b/voltha/adapters/microsemi/RubyAdapter.py
@@ -22,13 +22,16 @@
from voltha.adapters.interface import IAdapterInterface
from voltha.adapters.microsemi.PAS5211_comm import PAS5211Communication
from voltha.adapters.microsemi.StateMachine import Disconnected
-#from voltha.protos.adapter_pb2 import Adapter, AdapterConfig, DeviceTypes
-#from voltha.protos.health_pb2 import HealthStatus
+
+from voltha.protos import third_party
+from voltha.protos.adapter_pb2 import Adapter, AdapterConfig, DeviceTypes
+from voltha.protos.health_pb2 import HealthStatus
from zope.interface import implementer
log = structlog.get_logger()
+_ = third_party
olt_conf = { 'olts' : { 'id' : 0, 'mac' : '00:0c:d5:00:01:00'}, 'iface' : 'eth3'}
@@ -37,11 +40,11 @@
def __init__(self, args, config):
self.args = args
self.config = config
- #self.descriptor = Adapter(
- # id='ruby',
- # config=AdapterConfig()
- # # TODO
- #)
+ self.descriptor = Adapter(
+ id='ruby',
+ config=AdapterConfig()
+ # TODO
+ )
self.comm = comm = PAS5211Communication(dst_mac=olt_conf['olts']['mac'],
iface=olt_conf['iface'])
self.olt = Disconnected(comm)
@@ -59,18 +62,15 @@
return self
def adapter_descriptor(self):
- pass
- #return self.descriptor
+ return self.descriptor
def device_types(self):
- pass
- #return DeviceTypes(
- # items=[] # TODO
- #)
+ return DeviceTypes(
+ items=[] # TODO
+ )
def health(self):
- pass
- #return HealthStatus(state=HealthStatus.HealthState.HEALTHY)
+ return HealthStatus(state=HealthStatus.HealthState.HEALTHY)
def change_master_state(self, master):
raise NotImplementedError()
diff --git a/voltha/adapters/microsemi/StateMachine.py b/voltha/adapters/microsemi/StateMachine.py
index 51289d7..67ffb2f 100644
--- a/voltha/adapters/microsemi/StateMachine.py
+++ b/voltha/adapters/microsemi/StateMachine.py
@@ -72,6 +72,7 @@
def run(self):
self.packet = self.comm.communicate(PAS5211MsgGetProtocolVersion())
+ self.packet.show()
if self.packet is not None:
self.completed = True
return self.completed
@@ -101,6 +102,7 @@
def run(self):
self.packet = self.comm.communicate(PAS5211MsgGetOltVersion())
+ self.packet.show()
if self.packet is not None:
self.completed = True
return self.completed
@@ -149,6 +151,7 @@
log.info('OLT has been disconnected')
return
self.packet = self.comm.communicate(PAS5211MsgGetOltVersion())
+ self.packet.show()
if self.packet is None:
self.completed = True
diff --git a/voltha/adapters/microsemi/main.py b/voltha/adapters/microsemi/main.py
index 3d63d6a..ca7afe0 100644
--- a/voltha/adapters/microsemi/main.py
+++ b/voltha/adapters/microsemi/main.py
@@ -19,7 +19,6 @@
from common.utils.dockerhelpers import get_my_containers_name
import os
from twisted.internet import reactor
-from twisted.internet.defer import inlineCallbacks
from voltha.adapters.microsemi.RubyAdapter import RubyAdapter
import yaml