diff --git a/sat/memory/memory.py b/sat/memory/memory.py index 72a72257..c5fdb516 100644 --- a/sat/memory/memory.py +++ b/sat/memory/memory.py @@ -26,7 +26,7 @@ log = getLogger(__name__) import os.path import copy from collections import namedtuple -from configparser import SafeConfigParser, NoOptionError, NoSectionError +from configparser import ConfigParser, NoOptionError, NoSectionError from uuid import uuid4 from twisted.python import failure from twisted.internet import defer, reactor, error @@ -229,7 +229,7 @@ def fixLocalDir(silent=True): @param silent (boolean): toggle logging output (must be True when called from sat.sh) """ - user_config = SafeConfigParser() + user_config = ConfigParser() try: user_config.read(C.CONFIG_FILES) except: diff --git a/sat/tools/config.py b/sat/tools/config.py index 8f7f1546..1877289e 100644 --- a/sat/tools/config.py +++ b/sat/tools/config.py @@ -23,7 +23,7 @@ import os import csv import json -from configparser import SafeConfigParser, DEFAULTSECT, NoOptionError, NoSectionError +from configparser import ConfigParser, DEFAULTSECT, NoOptionError, NoSectionError from xdg import BaseDirectory from sat.core.log import getLogger from sat.core.constants import Const as C @@ -42,7 +42,7 @@ def fixConfigOption(section, option, value, silent=True): @param value (str): the new value @param silent (boolean): toggle logging output (must be True when called from sat.sh) """ - config = SafeConfigParser() + config = ConfigParser() target_file = None for file_ in C.CONFIG_FILES[::-1]: # we will eventually update the existing file with the highest priority, @@ -72,7 +72,7 @@ def fixConfigOption(section, option, value, silent=True): def parseMainConf(): """look for main .ini configuration file, and parse it""" - config = SafeConfigParser(defaults=C.DEFAULT_CONFIG) + config = ConfigParser(defaults=C.DEFAULT_CONFIG) try: config.read(C.CONFIG_FILES) except Exception as e: @@ -83,7 +83,7 @@ def parseMainConf(): def getConfig(config, section, name, default=None): """Get a configuration option - @param config (SafeConfigParser): the configuration instance + @param config (ConfigParser): the configuration instance @param section (str): section of the config file (None or '' for DEFAULT) @param name (str): name of the option @param default: value to use if not found, or Exception to raise an exception