parameters: (ctx, config)
docstring: Downloading the kafka tar file.
docstring_summary: Downloading the kafka tar file.
docstring_tokens: Downloading the kafka tar file .
function: def install_kafka(ctx, config):
      """
      Downloading the kafka tar file.
      """
      assert isinstance(config, dict)
      log.info('Installing Kafka...')
  
      for (client, _) in config.items():
          (remote,) = ctx.cluster.only(client).remotes.keys()
          test_dir=teuthology.get_testdir(ctx)
          current_version = get_kafka_version(config)
  
          link1 = 'https://archive.apache.org/dist/kafka/' + current_version + '/kafka-' + current_version + '-src.tgz'
          ctx.cluster.only(client).run(
              args=['cd', '{tdir}'.format(tdir=test_dir), run.Raw('&&'), 'wget', link1],
          )
  
          file1 = 'kafka-' + current_version + '-src.tgz'
          ctx.cluster.only(client).run(
              args=['cd', '{tdir}'.format(tdir=test_dir), run.Raw('&&'), 'tar', '-xvzf', file1],
          )
  
      try:
          yield
      finally:
          log.info('Removing packaged dependencies of Kafka...')
          test_dir=get_kafka_dir(ctx, config)
          current_version = get_kafka_version(config)
          for (client,_) in config.items():
              ctx.cluster.only(client).run(
                  args=['rm', '-rf', '{tdir}/logs'.format(tdir=test_dir)],
              )
  
              ctx.cluster.only(client).run(
                  args=['rm', '-rf', test_dir],
              )
  
              rmfile1 = 'kafka-' + current_version + '-src.tgz'
              ctx.cluster.only(client).run(
                  args=['rm', '-rf', '{tdir}/{doc}'.format(tdir=teuthology.get_testdir(ctx),doc=rmfile1)],
              )
function_tokens: def install_kafka ( ctx , config ) : assert isinstance ( config , dict ) log . info ( 'Installing Kafka...' ) for ( client , _ ) in config . items ( ) : ( remote , ) = ctx . cluster . only ( client ) . remotes . keys ( ) test_dir = teuthology . get_testdir ( ctx ) current_version = get_kafka_version ( config ) link1 = 'https://archive.apache.org/dist/kafka/' + current_version + '/kafka-' + current_version + '-src.tgz' ctx . cluster . only ( client ) . run ( args = [ 'cd' , '{tdir}' . format ( tdir = test_dir ) , run . Raw ( '&&' ) , 'wget' , link1 ] , ) file1 = 'kafka-' + current_version + '-src.tgz' ctx . cluster . only ( client ) . run ( args = [ 'cd' , '{tdir}' . format ( tdir = test_dir ) , run . Raw ( '&&' ) , 'tar' , '-xvzf' , file1 ] , ) try : yield finally : log . info ( 'Removing packaged dependencies of Kafka...' ) test_dir = get_kafka_dir ( ctx , config ) current_version = get_kafka_version ( config ) for ( client , _ ) in config . items ( ) : ctx . cluster . only ( client ) . run ( args = [ 'rm' , '-rf' , '{tdir}/logs' . format ( tdir = test_dir ) ] , ) ctx . cluster . only ( client ) . run ( args = [ 'rm' , '-rf' , test_dir ] , ) rmfile1 = 'kafka-' + current_version + '-src.tgz' ctx . cluster . only ( client ) . run ( args = [ 'rm' , '-rf' , '{tdir}/{doc}' . format ( tdir = teuthology . get_testdir ( ctx ) , doc = rmfile1 ) ] , )