riptano / ccm

A script to easily create and destroy an Apache Cassandra cluster on localhost
Apache License 2.0
1.22k stars 303 forks source link

Fix stress py3 compat #651

Closed ptnapoleon closed 6 years ago

ptnapoleon commented 6 years ago

From https://github.com/riptano/ccm/commit/669886a5bb9e96d8ce1a885454613ce0f064d6c8 "

There was another concern (did not include it in my pull request, thought probably best to fix in a separate pull request) with python3 compatibility. ccm node1 stress outputs

Traceback (most recent call last):
  File "/usr/bin/ccm", line 4, in <module>
    __import__('pkg_resources').run_script('ccm==3.1.2', 'ccm')
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 750, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1534, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib/python3.6/site-packages/ccm-3.1.2-py3.6.egg/EGG-INFO/scripts/ccm", line 105, in <module>
  File "/usr/lib/python3.6/site-packages/ccm-3.1.2-py3.6.egg/ccmlib/cmds/node_cmds.py", line 602, in run
  File "/usr/lib/python3.6/site-packages/ccm-3.1.2-py3.6.egg/ccmlib/node.py", line 1301, in stress
  File "/usr/lib/python3.6/site-packages/ccm-3.1.2-py3.6.egg/ccmlib/node.py", line 2068, in handle_external_tool_process
  File "/usr/lib/python3.6/site-packages/ccm-3.1.2-py3.6.egg/ccmlib/node.py", line 59, in __init__
TypeError: must be str, not bytes

There is a simple fix for this by adding a decode when parsing the stdout,stderr in ToolError