diff options
author | vmaffione <v.maffione@gmail.com> | 2017-04-19 17:28:16 +0000 |
---|---|---|
committer | vmaffione <v.maffione@gmail.com> | 2017-04-19 17:28:16 +0000 |
commit | a4879434ae2fc47f1514d1af180ed2191be7cb53 (patch) | |
tree | 4c2a4be14e1aa82cacc6041b28054478087b2284 /rumba/ssh_support.py | |
parent | 558682e5b59e1a62b92368a37d90cd2249e313c3 (diff) | |
parent | 91d22038f85b1f8a9e20772d5f6a6f7ad37963f2 (diff) | |
download | rumba-a4879434ae2fc47f1514d1af180ed2191be7cb53.tar.gz rumba-a4879434ae2fc47f1514d1af180ed2191be7cb53.zip |
Merge branch 'irati-issues' into 'master'
Fixes for issues #4 and #5 (irati plugin and vlans)
See merge request !34
Diffstat (limited to 'rumba/ssh_support.py')
-rw-r--r-- | rumba/ssh_support.py | 10 |
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" |