def cqlsh(cluster_name='cassandra', **kwargs): if is_cassandra_installed(): cluster = ccmlib.cluster.Cluster.load(ccm_home, cluster_name) cmd = "{cqlsh} 127.0.0.1 {args}".format( cqlsh=os.path.join(cluster.get_cassandra_dir(), 'bin', 'cqlsh'), args=''.join(kwargs['args'])) os.system(cmd)
def nodetool(cluster_name='cassandra', **kwargs): if is_cassandra_installed(): cluster = ccmlib.cluster.Cluster.load(ccm_home, cluster_name) cmd = "{nodetool} -p 7100 {args}".format( nodetool=os.path.join(cluster.get_cassandra_dir(), 'bin', 'nodetool'), args=''.join(kwargs['args'])) os.environ['CASSANDRA_INCLUDE'] = os.path.join(ccm_home, cluster_name, 'node1', 'bin', 'cassandra.in.sh') os.system(cmd)