Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Remove obsolete FDS tests
[csit.git]
/
resources
/
libraries
/
python
/
Namespaces.py
diff --git
a/resources/libraries/python/Namespaces.py
b/resources/libraries/python/Namespaces.py
index
d92dfd7
..
00d6153
100644
(file)
--- a/
resources/libraries/python/Namespaces.py
+++ b/
resources/libraries/python/Namespaces.py
@@
-13,7
+13,7
@@
"""Linux namespace utilities library."""
"""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):
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)
:raises RuntimeError: Interface could not be attached.
"""
cmd = 'ip link set {0} netns {1}'.format(interface, namespace)
- (r
c
, _, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True)
- if r
c
!= 0:
+ (r
et_code
, _, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True)
+ if r
et_code
!= 0:
raise RuntimeError(
'Could not attach interface, reason:{}'.format(stderr))
cmd = 'ip netns exec {} ip link set {} up'.format(
namespace, interface)
raise RuntimeError(
'Could not attach interface, reason:{}'.format(stderr))
cmd = 'ip netns exec {} ip link set {} up'.format(
namespace, interface)
- (r
c
, _, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True)
- if r
c
!= 0:
+ (r
et_code
, _, stderr) = exec_cmd(node, cmd, timeout=5, sudo=True)
+ if r
et_code
!= 0:
raise RuntimeError(
'Could not set interface state, reason:{}'.format(stderr))
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)
for namespace in self._namespaces:
print "Cleaning namespace {}".format(namespace)
cmd = 'ip netns delete {}'.format(namespace)
- (r
c, stdout, stderr
) = exec_cmd(node, cmd, timeout=5, sudo=True)
- if r
c
!= 0:
+ (r
et_code, _, _
) = exec_cmd(node, cmd, timeout=5, sudo=True)
+ if r
et_code
!= 0:
raise RuntimeError('Could not delete namespace')
raise RuntimeError('Could not delete namespace')