Merge "Print JSON-compatible booleans"

This commit is contained in:
Jenkins 2015-02-19 22:41:56 +00:00 committed by Gerrit Code Review
commit 9d70d50ff3
2 changed files with 2 additions and 2 deletions

View File

@ -110,7 +110,7 @@ def print_key(
raise exc.ConfigException(
'key %s does not exist in %s' % (key, config_path))
value_types.ensure_type(str(config), type_name)
if isinstance(config, (dict, list)):
if isinstance(config, (dict, list, bool)):
print(json.dumps(config))
else:
print(str(config))

View File

@ -137,7 +137,7 @@ class TestRunOSConfigApplier(testtools.TestCase):
['os-apply-config.py', '--metadata', self.path, '--key',
'y', '--type', 'raw']))
self.stdout.seek(0)
self.assertEqual(str(CONFIG['y']),
self.assertEqual("false",
self.stdout.read().strip())
self.assertEqual('', self.logger.output)