From dc3f8e747da0df24c85b84cf3c7af31e62f2cedb Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Dec 05 2017 09:57:30 +0000 Subject: bin/get_roles.py: use yaml.dump to construct the yaml output --- diff --git a/bin/get_roles.py b/bin/get_roles.py index 8a5e553..bed79ed 100755 --- a/bin/get_roles.py +++ b/bin/get_roles.py @@ -47,9 +47,7 @@ def print_roles(): if args.out == 'python': print(roles) elif args.out == 'yaml': - print('roles:') - for role in roles: - print(' - %s' % role) + print(yaml.dump({'roles': roles}, default_flow_style=False)) else: print(' '.join(roles))