def read_file_as_root(file_path):
 try:
  (out, _err) = execute('cat', file_path, run_as_root=True)
  return out
 except processutils.ProcessExecutionError:
  raise exception.FileNotFound(file_path=file_path)

def read_file_as_root ( file_path ) : try : ( out , _err ) = execute ( 'cat' , file_path , run_as_root = True ) return out except processutils . ProcessExecutionError : raise exception . FileNotFound ( file_path = file_path )
secure helper to read file as root .