# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+from __future__ import absolute_import
import logging
import subprocess
import traceback
+
import yardstick.ssh as ssh
-import basemonitor as basemonitor
+from yardstick.benchmark.scenarios.availability.monitor import basemonitor
LOG = logging.getLogger(__name__)
def _execute_shell_command(command):
- '''execute shell script with error handling'''
+ """execute shell script with error handling"""
exitcode = 0
output = []
try:
node_name = self._config.get("host", None)
if node_name:
host = self._context[node_name]
- ip = host.get("ip", None)
- user = host.get("user", "root")
- ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT)
- key_filename = host.get("key_filename", "~/.ssh/id_rsa")
- self.connection = ssh.SSH(user, ip, key_filename=key_filename,
- port=ssh_port)
+ self.connection = ssh.SSH.from_node(host,
+ defaults={"user": "root"})
self.connection.wait(timeout=600)
LOG.debug("ssh host success!")