Browse Source

Merge "Support boolean values in get_default"

changes/41/630041/8
Zuul 2 years ago
committed by Gerrit Code Review
parent
commit
77e1316419
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      zuul/lib/config.py

+ 3
- 1
zuul/lib/config.py View File

@ -17,7 +17,9 @@ def get_default(config, section, option, default=None, expand_user=False):
if config.has_option(section, option):
# Need to be ensured that we get suitable
# type from config file by default value
if isinstance(default, int):
if isinstance(default, bool):
value = config.getboolean(section, option)
elif isinstance(default, int):
value = config.getint(section, option)
else:
value = config.get(section, option)


Loading…
Cancel
Save