aboutsummaryrefslogtreecommitdiff
path: root/rumba/ssh_support.py
diff options
context:
space:
mode:
authorMarco Capitani <m.capitani@nextworks.it>2017-04-19 11:52:21 +0200
committerMarco Capitani <m.capitani@nextworks.it>2017-04-19 11:52:21 +0200
commit91d22038f85b1f8a9e20772d5f6a6f7ad37963f2 (patch)
treeebda1768f834f62c58776988d92fa8562b6b1e0e /rumba/ssh_support.py
parent1d3022acb3fa3067f2027ae1a2c61aa99790c024 (diff)
downloadrumba-91d22038f85b1f8a9e20772d5f6a6f7ad37963f2.tar.gz
rumba-91d22038f85b1f8a9e20772d5f6a6f7ad37963f2.zip
Fixes for issues #4 and #5 (irati plugin and vlans)
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"