def _gluster_output_cleanup(result):
 ret = ''
 for line in result.splitlines():
  if line.startswith('gluster>'):
   ret += line[9:].strip()
  else:
   ret += line.strip()
 return ret

def _gluster_output_cleanup ( result ) : ret = '' for line in result . splitlines ( ) : if line . startswith ( 'gluster>' ) : ret += line [ 9 : ] . strip ( ) else : ret += line . strip ( ) return ret
gluster versions prior to 6 have a bug that requires tricking isatty .