aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/TrafficGenerator.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2016-12-15 10:52:33 +0100
committerTibor Frank <tifrank@cisco.com>2016-12-16 08:35:32 +0100
commitcf561a6e3d4c4fbd78ab6c9d0a9aa817bb3300fc (patch)
tree0b4d5d2dbda78223d77d76e237285396d42c868e /resources/libraries/python/TrafficGenerator.py
parent677ae40a2be6db9f49b19ada3c4299a8904f7784 (diff)
Pylint fixes
- Fix PyLint errors - Fix comments in touched python modules Change-Id: I26db2d292a41969cf38b9b0bdd49c4fb15349102 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/libraries/python/TrafficGenerator.py')
-rw-r--r--resources/libraries/python/TrafficGenerator.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py
index 87437d8284..8d187c92dc 100644
--- a/resources/libraries/python/TrafficGenerator.py
+++ b/resources/libraries/python/TrafficGenerator.py
@@ -56,9 +56,9 @@ class TGDropRateSearchImpl(DropRateSearch):
tg_instance = BuiltIn().get_library_instance(
'resources.libraries.python.TrafficGenerator')
- if tg_instance._node['subtype'] is None:
+ if tg_instance.node['subtype'] is None:
raise RuntimeError('TG subtype not defined')
- elif tg_instance._node['subtype'] == NodeSubTypeTG.TREX:
+ elif tg_instance.node['subtype'] == NodeSubTypeTG.TREX:
unit_rate = str(rate) + self.get_rate_type_str()
tg_instance.trex_stl_start_remote_exec(self.get_duration(),
unit_rate, frame_size,
@@ -88,6 +88,7 @@ class TGDropRateSearchImpl(DropRateSearch):
'resources.libraries.python.TrafficGenerator')
return tg_instance.get_latency_int()
+
class TrafficGenerator(object):
"""Traffic Generator."""
@@ -104,6 +105,15 @@ class TrafficGenerator(object):
# T-REX interface order mapping
self._ifaces_reordered = 0
+ @property
+ def node(self):
+ """Getter.
+
+ :returns: Traffic generator node.
+ :rtype: dict
+ """
+ return self._node
+
def get_loss(self):
"""Return number of lost packets.