diff options
author | Vratko Polak <vrpolak@cisco.com> | 2019-09-13 15:40:54 +0200 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2019-09-18 12:21:07 +0000 |
commit | 3e0d781efd5eee2624f08bec140f9000bbeb362a (patch) | |
tree | 0e69daad86a093e93672dc4a28d72cb650057266 /resources | |
parent | 2fc48e8d0a4712ec99dd2bb3a814ec9cb2bc12cf (diff) |
Fix errors found by pylint
Change-Id: I0c2bee5a1ff8ad29e47c4f947388e7b97dd17fff
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources')
-rw-r--r-- | resources/libraries/python/ContainerUtils.py | 10 | ||||
-rw-r--r-- | resources/libraries/python/TrafficGenerator.py | 3 |
2 files changed, 6 insertions, 7 deletions
diff --git a/resources/libraries/python/ContainerUtils.py b/resources/libraries/python/ContainerUtils.py index 6fea804443..ae820b306b 100644 --- a/resources/libraries/python/ContainerUtils.py +++ b/resources/libraries/python/ContainerUtils.py @@ -640,12 +640,10 @@ class LXC(ContainerEngine): "sh -c 'mkdir -p {host_dir}'".format(host_dir=host_dir)) options = 'bind,create=dir' \ if guest_dir.endswith('/') else 'bind,create=file' - entry = 'lxc.mount.entry = {host_dir} '\ - '{guest_dir} none ' \ - '{options} 0 0'.format(c=self.container, - host_dir=host_dir, - guest_dir=guest_dir[1:], - options=options) + entry = 'lxc.mount.entry = {host_dir} {guest_dir} none ' \ + '{options} 0 0'.format( + host_dir=host_dir, guest_dir=guest_dir[1:], + options=options) ret, _, _ = self.container.ssh.exec_command_sudo( "sh -c 'echo \"{e}\" >> /var/lib/lxc/{c.name}/config'". format(e=entry, c=self.container)) diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py index f6020299c5..489b44572b 100644 --- a/resources/libraries/python/TrafficGenerator.py +++ b/resources/libraries/python/TrafficGenerator.py @@ -147,6 +147,7 @@ class TrafficGenerator(AbstractMeasurer): self.frame_size = None self.traffic_profile = None self.warmup_time = None + self.traffic_directions = None @property def node(self): @@ -658,7 +659,7 @@ class TrafficGenerator(AbstractMeasurer): duration = time.time() - self._start_time self._start_time = None if transmit_rate is None: - transmit_rate = self._rate * (1.0 if self.uinidirection else 2.0) + transmit_rate = self._rate * self.traffic_directions transmit_count = int(self.get_sent()) loss_count = int(self.get_loss()) measurement = ReceiveRateMeasurement( |