def get_exclude_string(client_dir):
 exclude_string = '--exclude=deps/* --exclude=tests/* --exclude=site_tests/*'
 prof_dir = os.path.join(client_dir, 'profilers')
 for f in os.listdir(prof_dir):
  if os.path.isdir(os.path.join(prof_dir, f)):
   exclude_string += (' --exclude=profilers/%s' % f)
 return exclude_string

def get_exclude_string ( client_dir ) : exclude_string = '--exclude=deps/* --exclude=tests/* --exclude=site_tests/*' prof_dir = os . path . join ( client_dir , 'profilers' ) for f in os . listdir ( prof_dir ) : if os . path . isdir ( os . path . join ( prof_dir , f ) ) : exclude_string += ( ' --exclude=profilers/%s' % f ) return exclude_string
get the exclude string for the tar command to exclude specific subdirectories inside client_dir .