From 865596357af3d8ea20333c756881e00c4a6106fb Mon Sep 17 00:00:00 2001 From: Marco Capitani Date: Mon, 23 Apr 2018 15:49:25 +0200 Subject: topology: accept float as delay parameter Before this would strictly accept only ints. Now it accepts floats and then rounds them, avoiding nasty surprises --- rumba/elements/topology.py | 4 ++-- 1 file 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) -- cgit v1.2.3