aboutsummaryrefslogtreecommitdiff
path: root/rumba/ssh_support.py
diff options
context:
space:
mode:
Diffstat (limited to 'rumba/ssh_support.py')
-rw-r--r--rumba/ssh_support.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py
index 0179c5d..d41eacb 100644
--- a/rumba/ssh_support.py
+++ b/rumba/ssh_support.py
@@ -52,7 +52,7 @@ def execute_commands(testbed, ssh_config, commands, time_out=3):
'''
ssh_client = get_ssh_client()
- if ssh_config.proxycommand != None:
+ if ssh_config.proxycommand is not None:
proxy = paramiko.ProxyCommand(ssh_config.proxycommand)
else:
proxy = None
@@ -96,7 +96,7 @@ def execute_command(testbed, ssh_config, command, time_out=3):
@return: stdout resulting from the command
'''
o = execute_commands(testbed, ssh_config, [command], time_out)
- if o != None:
+ if o is not None:
return o
@@ -112,7 +112,7 @@ def copy_file_to_testbed(testbed, ssh_config, text, file_name):
'''
ssh_client = get_ssh_client()
- if ssh_config.proxycommand != None:
+ if ssh_config.proxycommand is not None:
proxy = paramiko.ProxyCommand(ssh_config.proxycommand)
else:
proxy = None
@@ -214,9 +214,7 @@ def setup_vlan(testbed, node, vlan_id, int_name):
args = {'ifname': str(int_name), 'vlan': str(vlan_id)}
- cmds = [sudo("ip link set %(ifname)s up"
- % args),
- sudo("ip link add link %(ifname)s name "
+ cmds = [sudo("ip link add link %(ifname)s name "
"%(ifname)s.%(vlan)s type vlan id %(vlan)s"
% args),
sudo("ifconfig %(ifname)s.%(vlan)s up"