Skip to content

Commit

Permalink
make jmx regex less greedy on windows, print stdout/stderr when -v pa…
Browse files Browse the repository at this point in the history
…ssed to start
  • Loading branch information
jmckenzie-dev committed Dec 5, 2014
1 parent f0e6354 commit 60ae78e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ccmlib/cluster.py
Expand Up @@ -254,6 +254,10 @@ def start(self, no_wait=False, verbose=False, wait_for_binary_proto=False, wait_
else:
for node, p, mark in started:
try:
if verbose:
print "[" + node.name + "] ------------------------------"
print p.stdout.read()
print p.stderr.read()
node.watch_log_for("Listening for thrift clients...", process=p, verbose=verbose, from_mark=mark)
except RuntimeError:
return None
Expand Down
6 changes: 3 additions & 3 deletions ccmlib/node.py
Expand Up @@ -464,7 +464,7 @@ def start(self,
env = common.make_cassandra_env(cdir, self.get_path())

if common.is_win():
self._clean_win_jmx();
self._clean_win_jmx()

pidfile = os.path.join(self.get_path(), 'cassandra.pid')
args = [ launch_bin, '-p', pidfile, '-Dcassandra.join_ring=%s' % str(join_ring) ]
Expand Down Expand Up @@ -1084,7 +1084,7 @@ def __update_logback(self):
common.replace_or_add_into_file_tail(conf_file, full_logger_pattern, logger_pattern + class_name + '" level="' + self.__classes_log_level[class_name] + '"/>')

def __update_envfile(self):
jmx_port_pattern='JMX_PORT='
jmx_port_pattern='^\s+\$JMX_PORT='
remote_debug_port_pattern='-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address='
conf_file = os.path.join(self.get_conf_dir(), common.CASSANDRA_ENV)
common.replace_in_file(conf_file, jmx_port_pattern, jmx_port_pattern + self.jmx_port)
Expand Down Expand Up @@ -1258,7 +1258,7 @@ def _clean_win_jmx(self):
if self.get_base_cassandra_version() >= 2.1:
sh_file = os.path.join(common.CASSANDRA_CONF_DIR, common.CASSANDRA_WIN_ENV)
dst = os.path.join(self.get_path(), sh_file)
common.replace_in_file(dst, "JMX_PORT=", " $JMX_PORT=\"" + self.jmx_port + "\"")
common.replace_in_file(dst, "^\s+\$JMX_PORT=", " $JMX_PORT=\"" + self.jmx_port + "\"")

# properly use single and double quotes to count for single quotes in the CASSANDRA_CONF path
common.replace_in_file(dst,'CASSANDRA_PARAMS=',' $env:CASSANDRA_PARAMS=\'-Dcassandra' + # -Dcassandra
Expand Down

0 comments on commit 60ae78e

Please sign in to comment.