You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sn...@apache.org on 2018/07/26 16:18:29 UTC

cassandra-dtest git commit: Fix jmxutils.py

Repository: cassandra-dtest
Updated Branches:
  refs/heads/master f210e532e -> f45a06b2e


Fix jmxutils.py

patch by Robert Stupp; reviewed by Philip Thompson and Jason Brown for CASSANDRA-9608


Project: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/commit/f45a06b2
Tree: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/tree/f45a06b2
Diff: http://git-wip-us.apache.org/repos/asf/cassandra-dtest/diff/f45a06b2

Branch: refs/heads/master
Commit: f45a06b2efd08e9971d29b0e15c9ba388e4ae6bd
Parents: f210e53
Author: Robert Stupp <sn...@snazy.de>
Authored: Wed Jul 25 16:03:35 2018 +0200
Committer: Robert Stupp <sn...@snazy.de>
Committed: Wed Jul 25 16:03:35 2018 +0200

----------------------------------------------------------------------
 tools/jmxutils.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra-dtest/blob/f45a06b2/tools/jmxutils.py
----------------------------------------------------------------------
diff --git a/tools/jmxutils.py b/tools/jmxutils.py
index 8c78022..b0d6c68 100644
--- a/tools/jmxutils.py
+++ b/tools/jmxutils.py
@@ -1,3 +1,4 @@
+import glob
 import json
 import os
 import subprocess
@@ -13,7 +14,6 @@ logger = logging.getLogger(__name__)
 
 JOLOKIA_JAR = os.path.join('lib', 'jolokia-jvm-1.2.3-agent.jar')
 CLASSPATH_SEP = ';' if common.is_win() else ':'
-JVM_OPTIONS = "jvm.options"
 
 
 def jolokia_classpath():
@@ -162,15 +162,16 @@ def remove_perf_disable_shared_mem(node):
     edits cassandra-env.sh (or the Windows equivalent), or jvm.options file on 3.2+ to remove that option.
     """
     if node.get_cassandra_version() >= LooseVersion('3.2'):
-        conf_file = os.path.join(node.get_conf_dir(), JVM_OPTIONS)
         pattern = '\-XX:\+PerfDisableSharedMem'
         replacement = '#-XX:+PerfDisableSharedMem'
+        for f in glob.glob(os.path.join(node.get_conf_dir(), common.JVM_OPTS_PATTERN)):
+            if os.path.isfile(f):
+                common.replace_in_file(f, pattern, replacement)
     else:
         conf_file = node.envfilename()
         pattern = 'PerfDisableSharedMem'
         replacement = ''
-
-    common.replace_in_file(conf_file, pattern, replacement)
+        common.replace_in_file(conf_file, pattern, replacement)
 
 
 class JolokiaAgent(object):


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org