original_docstring: 
      Attach the logs, core-files, bt and contrail-version to a specified location
      
      If argument duration is specified it will collect the cassandra logs for specifed
      duration. Unit of the argument duration is minute. If not specifed it will collect
      cassandra log for system uptime
      
docstring: Attach the logs, core-files, bt and contrail-version to a specified location
  If argument duration is specified it will collect the cassandra logs for specifed
  duration. Unit of the argument duration is minute. If not specifed it will collect
  cassandra log for system uptime
docstring_tokens: Attach the logs core - files bt and contrail - version to a specified location If argument duration is specified it will collect the cassandra logs for specifed duration . Unit of the argument duration is minute . If not specifed it will collect cassandra log for system uptime
code: def attach_logs_cores(bug_id, timestamp=None, duration=None, analytics_log='yes'):
      '''
      Attach the logs, core-files, bt and contrail-version to a specified location
      
      If argument duration is specified it will collect the cassandra logs for specifed
      duration. Unit of the argument duration is minute. If not specifed it will collect
      cassandra log for system uptime
      '''
      build= env.roledefs['build'][0]
      if timestamp:
          folder= '%s/%s' %( bug_id, timestamp) 
      else:
          time_str = dt.now().strftime("%Y_%m_%d_%H_%M_%S")
          folder='%s/%s' %(bug_id, time_str)
      local('mkdir -p %s' % ( folder ) )
      execute(tar_logs_cores)
      if analytics_log == 'yes':
          execute(get_cassandra_logs,duration)
      with hide('everything'):
          for host in env.roledefs['all']:
              with settings( host_string=host, password=get_env_passwords(host),
                             connection_attempts=3, timeout=20, warn_only=True):
                  get('/var/log/logs_*.tgz', '%s/' %( folder ) )
                  get('/var/crashes/*gz', '%s/' %( folder ) )
                  get('/var/log/gdb_*.log','%s/' %( folder ) )
                  get('/var/log/contrail_version*.log','%s/' %( folder ) )
                  if analytics_log is 'yes':
                      get('/var/log/cassandra_log*.gz','%s/' %( folder ) )
  
      print "\nAll logs and cores are saved in %s of %s" %(folder, env.host)
code_tokens: def attach_logs_cores ( bug_id , timestamp = None , duration = None , analytics_log = 'yes' ) : build = env . roledefs [ 'build' ] [ 0 ] if timestamp : folder = '%s/%s' % ( bug_id , timestamp ) else : time_str = dt . now ( ) . strftime ( "%Y_%m_%d_%H_%M_%S" ) folder = '%s/%s' % ( bug_id , time_str ) local ( 'mkdir -p %s' % ( folder ) ) execute ( tar_logs_cores ) if analytics_log == 'yes' : execute ( get_cassandra_logs , duration ) with hide ( 'everything' ) : for host in env . roledefs [ 'all' ] : with settings ( host_string = host , password = get_env_passwords ( host ) , connection_attempts = 3 , timeout = 20 , warn_only = True ) : get ( '/var/log/logs_*.tgz' , '%s/' % ( folder ) ) get ( '/var/crashes/*gz' , '%s/' % ( folder ) ) get ( '/var/log/gdb_*.log' , '%s/' % ( folder ) ) get ( '/var/log/contrail_version*.log' , '%s/' % ( folder ) ) if analytics_log is 'yes' : get ( '/var/log/cassandra_log*.gz' , '%s/' % ( folder ) ) print "\nAll logs and cores are saved in %s of %s" % ( folder , env . host )
short_docstring: Attach the logs, core-files, bt and contrail-version to a specified location
  If argument duration is specified it will collect the cassandra logs for specifed
  duration.
short_docstring_tokens: Attach the logs core - files bt and contrail - version to a specified location If argument duration is specified it will collect the cassandra logs for specifed duration .
comment: '''
      Attach the logs, core-files, bt and contrail-version to a specified location
      
      If argument duration is specified it will collect the cassandra logs for specifed
      duration. Unit of the argument duration is minute. If not specifed it will collect
      cassandra log for system uptime
      '''