Merge "Print JSON-compatible booleans"
This commit is contained in:
commit
9d70d50ff3
@ -110,7 +110,7 @@ def print_key(
|
|||||||
raise exc.ConfigException(
|
raise exc.ConfigException(
|
||||||
'key %s does not exist in %s' % (key, config_path))
|
'key %s does not exist in %s' % (key, config_path))
|
||||||
value_types.ensure_type(str(config), type_name)
|
value_types.ensure_type(str(config), type_name)
|
||||||
if isinstance(config, (dict, list)):
|
if isinstance(config, (dict, list, bool)):
|
||||||
print(json.dumps(config))
|
print(json.dumps(config))
|
||||||
else:
|
else:
|
||||||
print(str(config))
|
print(str(config))
|
||||||
|
@ -137,7 +137,7 @@ class TestRunOSConfigApplier(testtools.TestCase):
|
|||||||
['os-apply-config.py', '--metadata', self.path, '--key',
|
['os-apply-config.py', '--metadata', self.path, '--key',
|
||||||
'y', '--type', 'raw']))
|
'y', '--type', 'raw']))
|
||||||
self.stdout.seek(0)
|
self.stdout.seek(0)
|
||||||
self.assertEqual(str(CONFIG['y']),
|
self.assertEqual("false",
|
||||||
self.stdout.read().strip())
|
self.stdout.read().strip())
|
||||||
self.assertEqual('', self.logger.output)
|
self.assertEqual('', self.logger.output)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user