VOL-2311 Removed unused class
Now with TP fully used this is redundant
and not even used
Change-Id: I91fd46803a27eeb6f6e9e41195b49e43e912dfd0
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 f05b293..5ab5b9c 100644
--- a/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
+++ b/python/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
@@ -62,7 +62,6 @@
from onu_tcont import OnuTCont
from pon_port import PonPort
from uni_port import UniPort, UniType
-from onu_traffic_descriptor import OnuTrafficDescriptor
from pyvoltha.common.tech_profile.tech_profile import TechProfile
from pyvoltha.adapters.extensions.omci.tasks.omci_test_request import OmciTestRequest
from pyvoltha.adapters.extensions.omci.omci_entities import AniG
@@ -378,16 +377,7 @@
tcontdict['q_sched_policy'] = q_sched_policy
tcontdict['uni_id'] = uni_id
- # TODO: Not sure what to do with any of this...
- tddata = dict()
- tddata['name'] = 'not-sure-td-profile'
- tddata['fixed-bandwidth'] = "not-sure-fixed"
- tddata['assured-bandwidth'] = "not-sure-assured"
- tddata['maximum-bandwidth'] = "not-sure-max"
- tddata['additional-bw-eligibility-indicator'] = "not-sure-additional"
-
- td = OnuTrafficDescriptor.create(tddata)
- tcont = OnuTCont.create(self, tcont=tcontdict, td=td)
+ tcont = OnuTCont.create(self, tcont=tcontdict)
self._pon.add_tcont(tcont)
diff --git a/python/adapters/brcm_openomci_onu/onu_gem_port.py b/python/adapters/brcm_openomci_onu/onu_gem_port.py
index dcde287..6b00c2e 100644
--- a/python/adapters/brcm_openomci_onu/onu_gem_port.py
+++ b/python/adapters/brcm_openomci_onu/onu_gem_port.py
@@ -89,7 +89,7 @@
self.tx_bytes = 0
def __str__(self):
- return "OnuGemPort - entity_id {}, alloc-id: {}, gem-id: {}, ".format(self.entity_id, self.alloc_id,
+ return "OnuGemPort - entity_id {}, alloc-id: {}, gem-id: {}".format(self.entity_id, self.alloc_id,
self.gem_id)
def __repr__(self):
diff --git a/python/adapters/brcm_openomci_onu/onu_tcont.py b/python/adapters/brcm_openomci_onu/onu_tcont.py
index da639d3..7472728 100644
--- a/python/adapters/brcm_openomci_onu/onu_tcont.py
+++ b/python/adapters/brcm_openomci_onu/onu_tcont.py
@@ -37,7 +37,7 @@
Broadcom ONU specific implementation
"""
- def __init__(self, handler, uni_id, alloc_id, q_sched_policy, traffic_descriptor):
+ def __init__(self, handler, uni_id, alloc_id, q_sched_policy):
self.log = structlog.get_logger(device_id=handler.device_id, uni_id=uni_id, alloc_id=alloc_id)
@@ -45,14 +45,13 @@
self.alloc_id = alloc_id
self._q_sched_policy = 0
self.q_sched_policy = q_sched_policy
- self.traffic_descriptor = traffic_descriptor
self._handler = handler
self._entity_id = None
def __str__(self):
- return "OnuTCont - uni_id: {}, entity_id {}, alloc-id: {}, q_sched_policy: {}, traffic_descriptor: {}".format(
- self.uni_id, self._entity_id, self.alloc_id, self.q_sched_policy, self.traffic_descriptor)
+ return "OnuTCont - uni_id: {}, entity_id: {}, alloc-id: {}, q_sched_policy: {}".format(
+ self.uni_id, self._entity_id, self.alloc_id, self.q_sched_policy)
def __repr__(self):
return str(self)
@@ -74,13 +73,12 @@
self._q_sched_policy = 0
@staticmethod
- def create(handler, tcont, td):
+ def create(handler, tcont):
return OnuTCont(handler,
tcont['uni_id'],
tcont['alloc-id'],
- tcont['q_sched_policy'],
- td
+ tcont['q_sched_policy']
)
@inlineCallbacks
diff --git a/python/adapters/brcm_openomci_onu/onu_traffic_descriptor.py b/python/adapters/brcm_openomci_onu/onu_traffic_descriptor.py
deleted file mode 100644
index 0e8820d..0000000
--- a/python/adapters/brcm_openomci_onu/onu_traffic_descriptor.py
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# Copyright 2018 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from __future__ import absolute_import
-import structlog
-from twisted.internet.defer import inlineCallbacks, returnValue, succeed
-
-
-NONE = 0
-BEST_EFFORT_SHARING = 1
-NON_ASSURED_SHARING = 2 # Should match xpon.py values
-DEFAULT = NONE
-
-
-class OnuTrafficDescriptor(object):
- """
- Broadcom ONU specific implementation
- """
- def __init__(self, fixed, assured, maximum,
- additional=DEFAULT,
- best_effort=None,
- name=None):
-
- self.log = structlog.get_logger(fixed=fixed, assured=assured, maximum=maximum, additional=additional)
-
- self.name = name
- self.fixed_bandwidth = fixed # bps
- self.assured_bandwidth = assured # bps
- self.maximum_bandwidth = maximum # bps
- self.additional_bandwidth_eligibility = additional
-
- self.best_effort = best_effort if additional == BEST_EFFORT_SHARING else None
-
-
- @staticmethod
- def to_string(value):
- return {
- NON_ASSURED_SHARING: "non-assured-sharing",
- BEST_EFFORT_SHARING: "best-effort-sharing",
- NONE: "none"
- }.get(value, "unknown")
-
-
- @staticmethod
- def from_value(value):
- return {
- 0: NONE,
- 1: BEST_EFFORT_SHARING,
- 2: NON_ASSURED_SHARING,
- }.get(value, DEFAULT)
-
-
- def __str__(self):
- return "OnuTrafficDescriptor: {}, {}/{}/{}".format(self.name,
- self.fixed_bandwidth,
- self.assured_bandwidth,
- self.maximum_bandwidth)
-
- def to_dict(self):
- val = {
- 'fixed-bandwidth': self.fixed_bandwidth,
- 'assured-bandwidth': self.assured_bandwidth,
- 'maximum-bandwidth': self.maximum_bandwidth,
- 'additional-bandwidth-eligibility': OnuTrafficDescriptor.to_string(self.additional_bandwidth_eligibility)
- }
- return val
-
-
- @staticmethod
- def create(traffic_disc):
-
- additional = OnuTrafficDescriptor.from_value(
- traffic_disc['additional-bw-eligibility-indicator'])
-
- # TODO: this is all stub code. Doesnt do anything yet. tech profiles will likely make this clearer
- best_effort = None
-
- return OnuTrafficDescriptor(traffic_disc['fixed-bandwidth'],
- traffic_disc['assured-bandwidth'],
- traffic_disc['maximum-bandwidth'],
- name=traffic_disc['name'],
- best_effort=best_effort,
- additional=additional)
-
- @inlineCallbacks
- def add_to_hardware(self, omci):
- results = succeed('TODO: Implement me')
- returnValue(results)
-
-
-