def _package_conf_file_to_dir(file_name):
 if (file_name in SUPPORTED_CONFS):
  path = BASE_PATH.format(file_name)
  if os.path.exists(path):
   if os.path.isdir(path):
    return False
   else:
    os.rename(path, (path + '.tmpbak'))
    os.mkdir(path, 493)
    with salt.utils.fopen((path + '.tmpbak')) as fh_:
     for line in fh_:
      line = line.strip()
      if (line and (not line.startswith('#'))):
       append_to_package_conf(file_name, string=line)
    os.remove((path + '.tmpbak'))
    return True
  else:
   os.mkdir(path, 493)
   return True

def _package_conf_file_to_dir ( file_name ) : if ( file_name in SUPPORTED_CONFS ) : path = BASE_PATH . format ( file_name ) if os . path . exists ( path ) : if os . path . isdir ( path ) : return False else : os . rename ( path , ( path + '.tmpbak' ) ) os . mkdir ( path , 493 ) with salt . utils . fopen ( ( path + '.tmpbak' ) ) as fh_ : for line in fh_ : line = line . strip ( ) if ( line and ( not line . startswith ( '#' ) ) ) : append_to_package_conf ( file_name , string = line ) os . remove ( ( path + '.tmpbak' ) ) return True else : os . mkdir ( path , 493 ) return True
convert a config file to a config directory .