summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-08-25 22:33:35 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-25 22:33:35 +0000
commita01f3f0d97778d4ec768d70ab531a420ae5a66a6 (patch)
tree2c2f52bfb886e9163b17688f21fb9dfa0b794fda
parentbcbea9565b14bae34706d7ca20257ec2b41985e1 (diff)
parent78daa59cd6c48046ee3fdfaa93e05ccbb1b2cbc7 (diff)
Merge "collectd: disable auto-provision"
-rw-r--r--yardstick/network_services/nfvi/resource.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/yardstick/network_services/nfvi/resource.py b/yardstick/network_services/nfvi/resource.py
index 2fb4a8e8e..48bcd3118 100644
--- a/yardstick/network_services/nfvi/resource.py
+++ b/yardstick/network_services/nfvi/resource.py
@@ -27,7 +27,7 @@ from oslo_config import cfg
from yardstick import ssh
from yardstick.network_services.nfvi.collectd import AmqpConsumer
-from yardstick.network_services.utils import provision_tool
+from yardstick.network_services.utils import get_nsb_option
LOG = logging.getLogger(__name__)
@@ -196,10 +196,21 @@ class ResourceProfile(object):
self._provide_config_file(bin_path, 'collectd.conf', kwargs)
def _start_collectd(self, connection, bin_path):
- LOG.debug("Starting collectd to collect NFVi stats")
connection.execute('sudo pkill -9 collectd')
- collectd = os.path.join(bin_path, "collectd.sh")
- provision_tool(connection, collectd)
+ bin_path = get_nsb_option("bin_path")
+ collectd_path = os.path.join(bin_path, "collectd", "collectd")
+ exit_status = connection.execute("which %s > /dev/null 2>&1" % collectd_path)[0]
+ if exit_status != 0:
+ LOG.warning("%s is not present disabling", collectd_path)
+ # disable auto-provisioning because it requires Internet access
+ # collectd_installer = os.path.join(bin_path, "collectd.sh")
+ # provision_tool(connection, collectd)
+ # http_proxy = os.environ.get('http_proxy', '')
+ # https_proxy = os.environ.get('https_proxy', '')
+ # connection.execute("sudo %s '%s' '%s'" % (
+ # collectd_installer, http_proxy, https_proxy))
+ return
+ LOG.debug("Starting collectd to collect NFVi stats")
self._prepare_collectd_conf(bin_path)
# Reset amqp queue
@@ -211,15 +222,8 @@ class ResourceProfile(object):
connection.execute("sudo rabbitmqctl start_app")
connection.execute("sudo service rabbitmq-server restart")
- # Run collectd
-
- http_proxy = os.environ.get('http_proxy', '')
- https_proxy = os.environ.get('https_proxy', '')
- connection.execute("sudo %s '%s' '%s'" %
- (collectd, http_proxy, https_proxy))
LOG.debug("Start collectd service.....")
- connection.execute(
- "sudo %s" % os.path.join(bin_path, "collectd", "collectd"))
+ connection.execute("sudo %s" % collectd_path)
LOG.debug("Done")
def initiate_systemagent(self, bin_path):