+ def _setup_intel_pmu(self, connection, bin_path):
+ pmu_event_path = os.path.join(bin_path, "pmu_event.json")
+ try:
+ self.plugins["intel_pmu"]["pmu_event_path"] = pmu_event_path
+ except KeyError:
+ # if intel_pmu is not a dict, force it into a dict
+ self.plugins["intel_pmu"] = {"pmu_event_path": pmu_event_path}
+ LOG.debug("Downloading event list for pmu_stats plugin")
+ cmd = 'cd {0}; PMU_EVENTS_PATH={1} python event_download_local.py'.format(
+ bin_path, pmu_event_path)
+ cmd = "sudo bash -c '{}'".format(cmd)
+ connection.execute(cmd)
+
+ def _setup_ovs_stats(self, connection):
+ try:
+ socket_path = self.plugins["ovs_stats"].get("ovs_socket_path", self.OVS_SOCKET_PATH)
+ except KeyError:
+ # ovs_stats is not a dict
+ socket_path = self.OVS_SOCKET_PATH
+ status = connection.execute("test -S {}".format(socket_path))[0]
+ if status != 0:
+ LOG.error("cannot find OVS socket %s", socket_path)