def _importSeceditConfig(infdata):
 try:
  _d = uuid.uuid4().hex
  _tSdbfile = '{0}\\{1}'.format(__salt__['config.get']('cachedir'), 'salt-secedit-import-{0}.sdb'.format(_d))
  _tInfFile = '{0}\\{1}'.format(__salt__['config.get']('cachedir'), 'salt-secedit-config-{0}.inf'.format(_d))
  _ret = __salt__['file.remove'](_tSdbfile)
  _ret = __salt__['file.remove'](_tInfFile)
  _ret = __salt__['file.touch'](_tInfFile)
  _ret = __salt__['file.append'](_tInfFile, infdata)
  _ret = __salt__['cmd.run']('secedit /configure /db {0} /cfg {1}'.format(_tSdbfile, _tInfFile))
  _ret = __salt__['file.remove'](_tSdbfile)
  _ret = __salt__['file.remove'](_tInfFile)
  return True
 except Exception as e:
  log.debug('error occurred while trying to import secedit data')
  return False

def _importSeceditConfig ( infdata ) : try : _d = uuid . uuid4 ( ) . hex _tSdbfile = '{0}\\{1}' . format ( __salt__ [ 'config.get' ] ( 'cachedir' ) , 'salt-secedit-import-{0}.sdb' . format ( _d ) ) _tInfFile = '{0}\\{1}' . format ( __salt__ [ 'config.get' ] ( 'cachedir' ) , 'salt-secedit-config-{0}.inf' . format ( _d ) ) _ret = __salt__ [ 'file.remove' ] ( _tSdbfile ) _ret = __salt__ [ 'file.remove' ] ( _tInfFile ) _ret = __salt__ [ 'file.touch' ] ( _tInfFile ) _ret = __salt__ [ 'file.append' ] ( _tInfFile , infdata ) _ret = __salt__ [ 'cmd.run' ] ( 'secedit /configure /db {0} /cfg {1}' . format ( _tSdbfile , _tInfFile ) ) _ret = __salt__ [ 'file.remove' ] ( _tSdbfile ) _ret = __salt__ [ 'file.remove' ] ( _tInfFile ) return True except Exception as e : log . debug ( 'error occurred while trying to import secedit data' ) return False
helper function to write data to a temp file/run secedit to import policy/cleanup .