# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
from __future__ import absolute_import
+
+import os
import logging
import subprocess
-import traceback
import yardstick.ssh as ssh
from yardstick.benchmark.scenarios.availability.monitor import basemonitor
output = subprocess.check_output(command, shell=True)
except Exception:
exitcode = -1
- output = traceback.format_exc()
- LOG.error("exec command '%s' error:\n ", command)
- LOG.error(traceback.format_exc())
+ LOG.error("exec command '%s' error:\n ", command, exc_info=True)
return exitcode, output
self.cmd = self._config["command_name"]
+ try:
+ insecure = os.environ['OS_INSECURE']
+ except KeyError:
+ pass
+ else:
+ if insecure.lower() == "true":
+ self.cmd = self.cmd + " --insecure"
+
def monitor_func(self):
exit_status = 0
exit_status, stdout = _execute_shell_command(self.cmd)