VOL-1460 Migrated openonu to voltha-protos
Change-Id: If0115ac617ff4bb8eaf60eaf550f1fffb75f8932
diff --git a/python/Makefile b/python/Makefile
index aab12bb..03b1684 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -78,6 +78,8 @@
ifdef LOCAL_PYVOLTHA
mkdir -p pyvoltha/dist
cp ../../pyvoltha/dist/*.tar.gz pyvoltha/dist/
+ mkdir -p voltha-protos/dist
+ cp ../../voltha-protos/dist/*.tar.gz voltha-protos/dist/
docker build $(DOCKER_BUILD_ARGS) -t ${REGISTRY}${REPOSITORY}voltha-openonu-adapter-base:${TAG} -f docker/Dockerfile.base_local .
else
docker build $(DOCKER_BUILD_ARGS) -t ${REGISTRY}${REPOSITORY}voltha-openonu-adapter-base:${TAG} -f docker/Dockerfile.base .
@@ -107,6 +109,7 @@
clean:
rm -rf pyvoltha
+ rm -rf voltha-protos
find . -name '*.pyc' | xargs rm -f
distclean: clean
@@ -134,8 +137,10 @@
ifdef LOCAL_PYVOLTHA
mkdir -p pyvoltha/dist
cp ../../pyvoltha/dist/*.tar.gz pyvoltha/dist/
+ mkdir -p voltha-protos/dist
+ cp ../../voltha-protos/dist/*.tar.gz voltha-protos/dist/
@ . ${VENVDIR}/bin/activate && \
- pip install pyvoltha/dist/*.tar.gz
+ pip install pyvoltha/dist/*.tar.gz && \
+ pip install voltha-protos/dist/*.tar.gz
endif
-
# end file
diff --git a/python/adapters/brcm_openomci_onu/brcm_openomci_onu.py b/python/adapters/brcm_openomci_onu/brcm_openomci_onu.py
index 31ba20c..ca90ac4 100644
--- a/python/adapters/brcm_openomci_onu/brcm_openomci_onu.py
+++ b/python/adapters/brcm_openomci_onu/brcm_openomci_onu.py
@@ -25,12 +25,11 @@
from pyvoltha.adapters.interface import IAdapterInterface
from pyvoltha.adapters.iadapter import OnuAdapter
-from pyvoltha.protos import third_party
-from pyvoltha.protos.adapter_pb2 import Adapter
-from pyvoltha.protos.adapter_pb2 import AdapterConfig
-from pyvoltha.protos.common_pb2 import LogLevel
-from pyvoltha.protos.device_pb2 import DeviceType, DeviceTypes, Port, Image
-from pyvoltha.protos.health_pb2 import HealthStatus
+from voltha_protos.adapter_pb2 import Adapter
+from voltha_protos.adapter_pb2 import AdapterConfig
+from voltha_protos.common_pb2 import LogLevel
+from voltha_protos.device_pb2 import DeviceType, DeviceTypes, Port, Image
+from voltha_protos.health_pb2 import HealthStatus
from pyvoltha.adapters.common.frameio.frameio import hexify
from pyvoltha.adapters.extensions.omci.openomci_agent import OpenOMCIAgent, OpenOmciAgentDefaults
@@ -41,8 +40,6 @@
from omci.brcm_mib_sync import BrcmMibSynchronizer
from copy import deepcopy
-
-_ = third_party
log = structlog.get_logger()
diff --git a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
index c9eefaf..84b4751 100644
--- a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
+++ b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
@@ -36,9 +36,8 @@
from pyvoltha.common.utils.registry import registry
from pyvoltha.common.config.config_backend import ConsulStore
from pyvoltha.common.config.config_backend import EtcdStore
-from pyvoltha.protos import third_party
-from pyvoltha.protos.common_pb2 import OperStatus, ConnectStatus, AdminState
-from pyvoltha.protos.openflow_13_pb2 import OFPXMC_OPENFLOW_BASIC, ofp_port
+from voltha_protos.common_pb2 import OperStatus, ConnectStatus, AdminState
+from voltha_protos.openflow_13_pb2 import OFPXMC_OPENFLOW_BASIC, ofp_port
from pyvoltha.adapters.extensions.omci.onu_configuration import OMCCVersion
from pyvoltha.adapters.extensions.omci.onu_device_entry import OnuDeviceEvents, \
OnuDeviceEntry, IN_SYNC_KEY
@@ -56,7 +55,6 @@
OP = EntityOperations
RC = ReasonCodes
-_ = third_party
log = structlog.get_logger()
_STARTUP_RETRY_WAIT = 20
diff --git a/python/adapters/brcm_openomci_onu/heartbeat.py b/python/adapters/brcm_openomci_onu/heartbeat.py
index f47883c..209876f 100644
--- a/python/adapters/brcm_openomci_onu/heartbeat.py
+++ b/python/adapters/brcm_openomci_onu/heartbeat.py
@@ -14,7 +14,7 @@
import structlog
from twisted.internet import reactor
-from pyvoltha.protos.common_pb2 import OperStatus, ConnectStatus
+from voltha_protos.common_pb2 import OperStatus, ConnectStatus
from pyvoltha.adapters.extensions.omci.omci_me import OntGFrame
diff --git a/python/adapters/brcm_openomci_onu/main.py b/python/adapters/brcm_openomci_onu/main.py
index 0a86500..6521ba7 100755
--- a/python/adapters/brcm_openomci_onu/main.py
+++ b/python/adapters/brcm_openomci_onu/main.py
@@ -42,13 +42,10 @@
from pyvoltha.adapters.kafka.kafka_inter_container_library import IKafkaMessagingProxy, \
get_messaging_proxy
from pyvoltha.adapters.kafka.kafka_proxy import KafkaProxy, get_kafka_proxy
-from pyvoltha.protos import third_party
-from pyvoltha.protos.adapter_pb2 import AdapterConfig
+from voltha_protos.adapter_pb2 import AdapterConfig
from brcm_openomci_onu import BrcmOpenomciOnuAdapter
-_ = third_party
-
defs = dict(
version_file='./VERSION',
config=os.environ.get('CONFIG', './openonu.yml'),
diff --git a/python/adapters/brcm_openomci_onu/pon_port.py b/python/adapters/brcm_openomci_onu/pon_port.py
index 9f9755b..8d5fc3b 100644
--- a/python/adapters/brcm_openomci_onu/pon_port.py
+++ b/python/adapters/brcm_openomci_onu/pon_port.py
@@ -15,8 +15,8 @@
import structlog
from twisted.internet.defer import inlineCallbacks, returnValue
-from pyvoltha.protos.common_pb2 import AdminState, OperStatus
-from pyvoltha.protos.device_pb2 import Port
+from voltha_protos.common_pb2 import AdminState, OperStatus
+from voltha_protos.device_pb2 import Port
from pyvoltha.adapters.extensions.omci.tasks.task import Task
BRDCM_DEFAULT_VLAN = 4091
diff --git a/python/adapters/brcm_openomci_onu/uni_port.py b/python/adapters/brcm_openomci_onu/uni_port.py
index fb3e06c..13588f7 100644
--- a/python/adapters/brcm_openomci_onu/uni_port.py
+++ b/python/adapters/brcm_openomci_onu/uni_port.py
@@ -15,13 +15,13 @@
import structlog
from enum import Enum
-from pyvoltha.protos.common_pb2 import OperStatus, AdminState
-from pyvoltha.protos.device_pb2 import Port
-from pyvoltha.protos.openflow_13_pb2 import OFPPF_10GB_FD
+from voltha_protos.common_pb2 import OperStatus, AdminState
+from voltha_protos.device_pb2 import Port
+from voltha_protos.openflow_13_pb2 import OFPPF_10GB_FD
from pyvoltha.common.utils.nethelpers import mac_str_to_tuple
-from pyvoltha.protos.logical_device_pb2 import LogicalPort
-from pyvoltha.protos.openflow_13_pb2 import OFPPS_LIVE, OFPPF_FIBER, OFPPS_LINK_DOWN
-from pyvoltha.protos.openflow_13_pb2 import ofp_port
+from voltha_protos.logical_device_pb2 import LogicalPort
+from voltha_protos.openflow_13_pb2 import OFPPS_LIVE, OFPPF_FIBER, OFPPS_LINK_DOWN
+from voltha_protos.openflow_13_pb2 import ofp_port
class UniType(Enum):
"""
diff --git a/python/docker/Dockerfile.base_local b/python/docker/Dockerfile.base_local
index 9b6ce9e..6944d5c 100644
--- a/python/docker/Dockerfile.base_local
+++ b/python/docker/Dockerfile.base_local
@@ -32,3 +32,6 @@
COPY pyvoltha/dist /pyvoltha/dist
RUN pip install /pyvoltha/dist/*.tar.gz
+COPY voltha-protos/dist /voltha-protos/dist
+RUN pip install /voltha-protos/dist/*.tar.gz
+
diff --git a/python/requirements.txt b/python/requirements.txt
index 3e688c0..9a87401 100644
--- a/python/requirements.txt
+++ b/python/requirements.txt
@@ -65,3 +65,4 @@
python-consul==0.6.2
afkak==3.0.0.dev20181106
pyvoltha==0.1.7
+voltha-protos==0.1.0