From 6131fd71b5f58a99ab4a1d85b42143699acd83b5 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Thu, 1 Jun 2017 15:40:44 +1200 Subject: kolla-build --list-dependencies use json, not pprint kolla-build --list-dependencies uses pprint, which prints almost-but-not-quite json. This makes it hard for other tools to parse its output. This change switches to a json output with an indent of 2. If there is interest in a default output which is friendly to both humans and software, YAML might be more appropriate. Change-Id: Icaead5a62a2d6510965524f68fb57dcf7494e618 Closes-Bug: #1694888 --- kolla/image/build.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'kolla/image') diff --git a/kolla/image/build.py b/kolla/image/build.py index 8a153fabd..c8aaa8ff9 100755 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -20,7 +20,6 @@ import errno import json import logging import os -import pprint import re import requests import shutil @@ -1029,7 +1028,7 @@ class KollaWorker(object): ancestry = {base.name: []} list_children(base.children, ancestry) - pprint.pprint(ancestry) + json.dump(ancestry, sys.stdout, indent=2) def find_parents(self): """Associate all images with parents and children""" -- cgit v1.2.3