Commit 19b24acd authored by Julien Muchembled's avatar Julien Muchembled

Do not fail if 'dynamic_master_list' is missing from configuration file

parent 3fdf29c7
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from ConfigParser import SafeConfigParser from ConfigParser import SafeConfigParser, NoOptionError
from . import util from . import util
from .util import parseNodeAddress from .util import parseNodeAddress
...@@ -39,7 +39,10 @@ class ConfigurationManager(object): ...@@ -39,7 +39,10 @@ class ConfigurationManager(object):
if self.parser is None: if self.parser is None:
value = self.defaults.get(key) value = self.defaults.get(key)
else: else:
value = self.parser.get(self.section, key) try:
value = self.parser.get(self.section, key)
except NoOptionError:
pass
if value is None and not optional: if value is None and not optional:
raise RuntimeError("Option '%s' is undefined'" % (key, )) raise RuntimeError("Option '%s' is undefined'" % (key, ))
return value return value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment