summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliang gao <jean.gaoliang@huawei.com>2016-07-07 03:25:57 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-07-07 03:25:57 +0000
commit991aaea442d2a36d43871224a7d96a7e7eea6910 (patch)
tree9ae16d60dbe3053714184a872d3756dfedf20e35
parenteacef205efa9289bccbf38d82df07cdc63486d35 (diff)
parentf3c77d013c0d2662316edcb671204a813aa40544 (diff)
Merge "fix the ssh bug when run tc043 in CI"
-rw-r--r--yardstick/benchmark/scenarios/networking/ping.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/yardstick/benchmark/scenarios/networking/ping.py b/yardstick/benchmark/scenarios/networking/ping.py
index 3af354850..08755a08b 100644
--- a/yardstick/benchmark/scenarios/networking/ping.py
+++ b/yardstick/benchmark/scenarios/networking/ping.py
@@ -41,11 +41,17 @@ class Ping(base.Scenario):
user = host.get('user', 'ubuntu')
ip = host.get('ip', None)
key_filename = host.get('key_filename', '/root/.ssh/id_rsa')
- password = host.get('password', 'root')
+ password = host.get('password', None)
+
+ if password is not None:
+ LOG.info("Log in via pw, user:%s, host:%s, pw:%s",
+ user, ip, password)
+ self.connection = ssh.SSH(user, ip, password=password)
+ else:
+ LOG.info("Log in via key, user:%s, host:%s, key_filename:%s",
+ user, ip, key_filename)
+ self.connection = ssh.SSH(user, ip, key_filename=key_filename)
- LOG.info("user:%s, host:%s, key_filename:%s", user, ip, key_filename)
- self.connection = ssh.SSH(user, ip, key_filename=key_filename,
- password=password)
self.connection.wait()
def run(self, result):