aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Capitani <m.capitani@nextworks.it>2018-04-23 15:49:25 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-04-24 10:41:13 +0000
commit865596357af3d8ea20333c756881e00c4a6106fb (patch)
tree4a61fe2597c58bf206e418ce382cb48c5a6f63a2
parent2b1d9a3a3a3da6f40f73704044e994c5f106bdc4 (diff)
downloadrumba-865596357af3d8ea20333c756881e00c4a6106fb.tar.gz
rumba-865596357af3d8ea20333c756881e00c4a6106fb.zip
topology: accept float as delay parameter
Before this would strictly accept only ints. Now it accepts floats and then rounds them, avoiding nasty surprises
-rw-r--r--rumba/elements/topology.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rumba/elements/topology.py b/rumba/elements/topology.py
index 2efbdff..3054782 100644
--- a/rumba/elements/topology.py
+++ b/rumba/elements/topology.py
@@ -315,7 +315,7 @@ class Delay(object):
Configure link delay.
:param delay: average delay in ms
- :type delay: :py:class:`int`
+ :type delay: :py:class:`int` or :py:class:`float`
:param jitter: jitter in ms
:type jitter: :py:class:`int`
:param correlation: correlation in %
@@ -463,7 +463,7 @@ class LinkQuality(object):
if rate and not rate > 0:
raise ValueError("Rate needs to be higher than 0")
- if isinstance(delay, int):
+ if isinstance(delay, int) or isinstance(delay, float):
delay = Delay(delay)
if isinstance(loss, int) or isinstance(loss, float):
loss = Loss(loss)