diff options
author | 2021-06-10 08:02:29 +0000 | |
---|---|---|
committer | 2021-06-10 12:18:54 +0000 | |
commit | 1e67773058ef2177e3e3a93d5ac3056cbf433012 (patch) | |
tree | 315f4f7e8ecb6b5ffb6572ca6e2f9ba57c6b427b /resources/libraries/python/IPUtil.py | |
parent | e16906eaa7e50dfd3bbf16542d1ea3656d45862c (diff) |
FIX: Pylint reduce
Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: I909942dbb920df7f0fe15c0c92cda92c3cd8d8ad
(cherry picked from commit 7829fea4a2c8936513fa95215b7d84997f814a69)
Diffstat (limited to 'resources/libraries/python/IPUtil.py')
-rw-r--r-- | resources/libraries/python/IPUtil.py | 48 |
1 files changed, 21 insertions, 27 deletions
diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py index 4d5753ea92..fdd7c66e18 100644 --- a/resources/libraries/python/IPUtil.py +++ b/resources/libraries/python/IPUtil.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -51,7 +51,6 @@ class FibPathType(IntEnum): class FibPathFlags(IntEnum): """FIB path flags.""" FIB_PATH_FLAG_NONE = 0 - # TODO: Name too long for pylint, fix in VPP. FIB_PATH_FLAG_RESOLVE_VIA_ATTACHED = 1 FIB_PATH_FLAG_RESOLVE_VIA_HOST = 2 @@ -67,26 +66,26 @@ class FibPathNhProto(IntEnum): class IpDscp(IntEnum): """DSCP code points.""" - IP_API_DSCP_CS0 = 0, - IP_API_DSCP_CS1 = 8, - IP_API_DSCP_AF11 = 10, - IP_API_DSCP_AF12 = 12, - IP_API_DSCP_AF13 = 14, - IP_API_DSCP_CS2 = 16, - IP_API_DSCP_AF21 = 18, - IP_API_DSCP_AF22 = 20, - IP_API_DSCP_AF23 = 22, - IP_API_DSCP_CS3 = 24, - IP_API_DSCP_AF31 = 26, - IP_API_DSCP_AF32 = 28, - IP_API_DSCP_AF33 = 30, - IP_API_DSCP_CS4 = 32, - IP_API_DSCP_AF41 = 34, - IP_API_DSCP_AF42 = 36, - IP_API_DSCP_AF43 = 38, - IP_API_DSCP_CS5 = 40, - IP_API_DSCP_EF = 46, - IP_API_DSCP_CS6 = 48, + IP_API_DSCP_CS0 = 0 + IP_API_DSCP_CS1 = 8 + IP_API_DSCP_AF11 = 10 + IP_API_DSCP_AF12 = 12 + IP_API_DSCP_AF13 = 14 + IP_API_DSCP_CS2 = 16 + IP_API_DSCP_AF21 = 18 + IP_API_DSCP_AF22 = 20 + IP_API_DSCP_AF23 = 22 + IP_API_DSCP_CS3 = 24 + IP_API_DSCP_AF31 = 26 + IP_API_DSCP_AF32 = 28 + IP_API_DSCP_AF33 = 30 + IP_API_DSCP_CS4 = 32 + IP_API_DSCP_AF41 = 34 + IP_API_DSCP_AF42 = 36 + IP_API_DSCP_AF43 = 38 + IP_API_DSCP_CS5 = 40 + IP_API_DSCP_EF = 46 + IP_API_DSCP_CS6 = 48 IP_API_DSCP_CS7 = 50 @@ -147,9 +146,6 @@ class IPUtil: with PapiSocketExecutor(node) as papi_exec: details = papi_exec.add(cmd, **args).get_details(err_msg) - # TODO: CSIT currently looks only whether the list is empty. - # Add proper value processing if values become important. - return details @staticmethod @@ -411,8 +407,6 @@ class IPUtil: :type namespace: str :raises RuntimeError: IP could not be deleted. """ - # TODO: Refactor command execution in namespaces into central - # methods (e.g. Namespace.exec_cmd_in_namespace) if namespace is not None: cmd = f"ip netns exec {namespace} ip addr del " \ f"{ip_addr}/{prefix_length} dev {interface}" |