From 46fe5e76701c3d06a5fe20924e943ca9febb5479 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Aug 11 2020 12:12:29 +0000 Subject: cli: revert-back the output of "get-package" This is needed to not require everyone who is parsing our command-line output to migrate to the new format (detected by beaker tests). --- diff --git a/cli/copr_cli/main.py b/cli/copr_cli/main.py index 54f10d9..68f0b4d 100644 --- a/cli/copr_cli/main.py +++ b/cli/copr_cli/main.py @@ -664,9 +664,16 @@ class Commands(object): ownername, projectname = self.parse_name(args.copr) kwargs = {"ownername": ownername, "projectname": projectname, "packagename": package.name} + # Keep output of copr-cli compatible with copr-cli <= 1.87. + api_provided_builds = package["builds"] + del package["builds"] + for key in ["latest_succeeded", "latest"]: + if key in api_provided_builds: + package[key + "_build"] = api_provided_builds[key] + if args.with_all_builds: builds = self.client.build_proxy.get_list(**kwargs) - package["builds"]["all"] = builds + package["builds"] = builds return package