def GetSecretFile(secret):
 if sys.platform.startswith('linux'):
  if (secret not in _tempfile_map):
   f = tempfile.TemporaryFile()
   set_close_exec(f.fileno())
   f.write(GetSecret(secret))
   f.flush()
   _tempfile_map[secret] = f
  return ('/dev/fd/%d' % _tempfile_map[secret].fileno())
 else:
  if (secret not in _tempfile_map):
   (_, name) = tempfile.mkstemp()
   with open(name, 'w') as f:
    f.write(GetSecret(secret))
   _tempfile_map[secret] = name
   atexit.register(os.remove, name)
  return _tempfile_map[secret]

def GetSecretFile ( secret ) : if sys . platform . startswith ( 'linux' ) : if ( secret not in _tempfile_map ) : f = tempfile . TemporaryFile ( ) set_close_exec ( f . fileno ( ) ) f . write ( GetSecret ( secret ) ) f . flush ( ) _tempfile_map [ secret ] = f return ( '/dev/fd/%d' % _tempfile_map [ secret ] . fileno ( ) ) else : if ( secret not in _tempfile_map ) : ( _ , name ) = tempfile . mkstemp ( ) with open ( name , 'w' ) as f : f . write ( GetSecret ( secret ) ) _tempfile_map [ secret ] = name atexit . register ( os . remove , name ) return _tempfile_map [ secret ]
fetches the named secret into a temporary file for use with modules requiring the contents be accessible via a named file .