From a286e9b3dcc0ced452c45639de4596a672095e40 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 23 Aug 2018 16:21:54 -0700 Subject: [PATCH] Fix composer-cli blueprints changes to get correct total blueprints/changes is different, each blueprint has it's own total, limited by the call's limit. So it needs to find the max total of all the requested blueprints. (cherry picked from commit 57674c9a1af4ad9f20d001d802ec2e2278a57ff6) --- src/composer/cli/blueprints.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/composer/cli/blueprints.py b/src/composer/cli/blueprints.py index 1872e2fe..bc8030b4 100644 --- a/src/composer/cli/blueprints.py +++ b/src/composer/cli/blueprints.py @@ -118,8 +118,14 @@ def blueprints_changes(socket_path, api_version, args, show_json=False): blueprints changes Display the changes for each blueprint. """ + def changes_total_fn(data): + """Return the maximum number of possible changes""" + + # Each blueprint can have a different total, return the largest one + return max([c["total"] for c in data["blueprints"]]) + api_route = client.api_url(api_version, "/blueprints/changes/%s" % (",".join(argify(args)))) - result = client.get_url_json_unlimited(socket_path, api_route) + result = client.get_url_json_unlimited(socket_path, api_route, total_fn=changes_total_fn) (rc, exit_now) = handle_api_result(result, show_json) if exit_now: return rc