Don't sort error messages.

This should make it easier to return more complex error structures.  It
also doesn't appear to matter - tests still pass without changes.

(cherry picked from commit 4c3f93e329)
This commit is contained in:
Chris Lumens 2018-08-07 15:27:58 -04:00
parent b4fa931eca
commit 31293f8460

View File

@ -1089,7 +1089,6 @@ def v0_api(api):
# Sort all the results by case-insensitive blueprint name # Sort all the results by case-insensitive blueprint name
changes = sorted(changes, key=lambda c: c["name"].lower()) changes = sorted(changes, key=lambda c: c["name"].lower())
blueprints = sorted(blueprints, key=lambda r: r["name"].lower()) blueprints = sorted(blueprints, key=lambda r: r["name"].lower())
errors = sorted(errors, key=lambda e: e.lower())
if out_fmt == "toml": if out_fmt == "toml":
# With TOML output we just want to dump the raw blueprint, skipping the rest. # With TOML output we just want to dump the raw blueprint, skipping the rest.
@ -1130,7 +1129,6 @@ def v0_api(api):
blueprints.append({"name":blueprint_name, "changes":commits, "total":len(commits)}) blueprints.append({"name":blueprint_name, "changes":commits, "total":len(commits)})
blueprints = sorted(blueprints, key=lambda r: r["name"].lower()) blueprints = sorted(blueprints, key=lambda r: r["name"].lower())
errors = sorted(errors, key=lambda e: e.lower())
return jsonify(blueprints=blueprints, errors=errors, offset=offset, limit=limit) return jsonify(blueprints=blueprints, errors=errors, offset=offset, limit=limit)