diff options
author | selias <samelias@cisco.com> | 2016-09-30 14:04:06 +0200 |
---|---|---|
committer | selias <samelias@cisco.com> | 2016-10-04 10:05:53 +0200 |
commit | a912d105f3a1d8fed0b4cf6b18e0ef7789be81bf (patch) | |
tree | 72fbbaa05aec1c7e3b903eff45624800a8c1d607 /resources/libraries/python/Namespaces.py | |
parent | edd554cdb32b124136f49cb17f711ecda0f0176c (diff) |
Fix pylint warnings in python libraries
- no functional changes
- fixes 80+ PEP-8 violations
Change-Id: Icf414778ec40d5cb44364fa69a876f9a1870c3c7
Signed-off-by: selias <samelias@cisco.com>
Diffstat (limited to 'resources/libraries/python/Namespaces.py')
-rw-r--r-- | resources/libraries/python/Namespaces.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/resources/libraries/python/Namespaces.py b/resources/libraries/python/Namespaces.py index d92dfd7e26..00d615350e 100644 --- a/resources/libraries/python/Namespaces.py +++ b/resources/libraries/python/Namespaces.py @@ -13,7 +13,7 @@ """Linux namespace utilities library.""" -from resources.libraries.python.ssh import exec_cmd_no_error, exec_cmd, SSH +from resources.libraries.python.ssh import exec_cmd_no_error, exec_cmd class Namespaces(object): @@ -46,14 +46,14 @@ class Namespaces(object): :raises RuntimeError: Interface could not be attached. """ cmd = 'ip link set {0} netns {1}'.format(interface, namespace) - (rc, _, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True) - if rc != 0: + (ret_code, _, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True) + if ret_code != 0: raise RuntimeError( 'Could not attach interface, reason:{}'.format(stderr)) cmd = 'ip netns exec {} ip link set {} up'.format( namespace, interface) - (rc, _, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True) - if rc != 0: + (ret_code, _, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True) + if ret_code != 0: raise RuntimeError( 'Could not set interface state, reason:{}'.format(stderr)) @@ -91,6 +91,6 @@ class Namespaces(object): for namespace in self._namespaces: print "Cleaning namespace {}".format(namespace) cmd = 'ip netns delete {}'.format(namespace) - (rc, stdout, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True) - if rc != 0: + (ret_code, _, _) = exec_cmd(node, cmd, timeout=5, sudo=True) + if ret_code != 0: raise RuntimeError('Could not delete namespace') |