def dropfile(cachedir, user=None):
 dfn = os.path.join(cachedir, '.dfn')
 mask = os.umask(191)
 try:
  log.info('Rotating AES key')
  if os.path.isfile(dfn):
   log.info('AES key rotation already requested')
   return
  if (os.path.isfile(dfn) and (not os.access(dfn, os.W_OK))):
   os.chmod(dfn, (stat.S_IRUSR | stat.S_IWUSR))
  with salt.utils.fopen(dfn, 'wb+') as fp_:
   fp_.write('')
  os.chmod(dfn, stat.S_IRUSR)
  if user:
   try:
    import pwd
    uid = pwd.getpwnam(user).pw_uid
    os.chown(dfn, uid, (-1))
   except (KeyError, ImportError, OSError, IOError):
    pass
 finally:
  os.umask(mask)

def dropfile ( cachedir , user = None ) : dfn = os . path . join ( cachedir , '.dfn' ) mask = os . umask ( 191 ) try : log . info ( 'Rotating AES key' ) if os . path . isfile ( dfn ) : log . info ( 'AES key rotation already requested' ) return if ( os . path . isfile ( dfn ) and ( not os . access ( dfn , os . W_OK ) ) ) : os . chmod ( dfn , ( stat . S_IRUSR | stat . S_IWUSR ) ) with salt . utils . fopen ( dfn , 'wb+' ) as fp_ : fp_ . write ( '' ) os . chmod ( dfn , stat . S_IRUSR ) if user : try : import pwd uid = pwd . getpwnam ( user ) . pw_uid os . chown ( dfn , uid , ( - 1 ) ) except ( KeyError , ImportError , OSError , IOError ) : pass finally : os . umask ( mask )
set an aes dropfile to request the master update the publish session key .