Commit 43ff431e authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Merge branch 'hotfix-0.13.1'

parents a4f07c2d c291f9da
...@@ -136,7 +136,7 @@ DEFAULTS = { ...@@ -136,7 +136,7 @@ DEFAULTS = {
class Config(RawConfigParser): class Config(RawConfigParser):
def __init__(self, path=None, with_defaults=True): def __init__(self, path=None, with_defaults=False):
RawConfigParser.__init__(self, dict_type=OrderedDict) RawConfigParser.__init__(self, dict_type=OrderedDict)
self.path = path or os.environ.get(CONFIG_ENV, CONFIG_PATH) self.path = path or os.environ.get(CONFIG_ENV, CONFIG_PATH)
...@@ -455,9 +455,9 @@ class Config(RawConfigParser): ...@@ -455,9 +455,9 @@ class Config(RawConfigParser):
def safe_to_print(self): def safe_to_print(self):
dump = u'[global]\n' dump = u'[global]\n'
for k, v in self.items('global'): for k, v in self.items('global', include_defaults=False):
dump += u'%s = %s\n' % (escape_ctrl_chars(k), escape_ctrl_chars(v)) dump += u'%s = %s\n' % (escape_ctrl_chars(k), escape_ctrl_chars(v))
for r, d in self.items(CLOUD_PREFIX): for r, d in self.items(CLOUD_PREFIX, include_defaults=False):
dump += u'\n[%s "%s"]\n' % (CLOUD_PREFIX, escape_ctrl_chars(r)) dump += u'\n[%s "%s"]\n' % (CLOUD_PREFIX, escape_ctrl_chars(r))
for k, v in d.items(): for k, v in d.items():
dump += u'%s = %s\n' % ( dump += u'%s = %s\n' % (
......
...@@ -483,7 +483,8 @@ class Config(TestCase): ...@@ -483,7 +483,8 @@ class Config(TestCase):
_cnf = Config(path=self.f.name) _cnf = Config(path=self.f.name)
bu_func = Config.items bu_func = Config.items
try: try:
Config.items = lambda cls, opt: itemsd[opt].items() Config.items = (
lambda cls, opt, include_defaults: itemsd[opt].items())
saved = _cnf.safe_to_print().split('\n') saved = _cnf.safe_to_print().split('\n')
glb, cld = saved[:5], saved[6:] glb, cld = saved[:5], saved[6:]
self.assertEqual(u'[global]', glb[0]) self.assertEqual(u'[global]', glb[0])
......
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