From 6e0e8fde5efc85e57cf4021991ec2d17298eaf3d Mon Sep 17 00:00:00 2001 From: Miikka Koistinen Date: Tue, 31 Jul 2018 17:03:10 +0300 Subject: Replace assert statements in PipelineRules The class PipelineRules uses assert statements to check the correctness of an input parameter IP address. This commit will modify these lines to use a dedicated function "common.utils.make_ipv4_address". JIRA: YARDSTICK-966 Change-Id: I1c4cc439a7716d36548125c87dfb0bc200714a56 Signed-off-by: Miikka Koistinen --- yardstick/common/utils.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'yardstick/common') diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py index 6c5389cd0..f1822a03d 100644 --- a/yardstick/common/utils.py +++ b/yardstick/common/utils.py @@ -291,6 +291,10 @@ def mac_address_to_hex_list(mac): return octets +def make_ipv4_address(ip_addr): + return ipaddress.IPv4Address(six.text_type(ip_addr)) + + def safe_ip_address(ip_addr): """ get ip address version v6 or v4 """ try: -- cgit 1.2.3-korg