Package: lavacli Version: 0.9.7-1 Severity: normal Tags: patch User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu eoan ubuntu-patch
Dear Maintainer, pyyaml 5.2.1 appears to have some changes in the default flow style used. Rather than representing sequences and dicts similary to python, it now defaults to printing them in longform [1]: - item 1 - item 2 etc. I've written a quick and heavyhanded patch to add default_flow_style=None to all of the calls to yaml.dump() that otherwise don't include options, but that might not be the best solution. Maybe upstream would rather fix the tests? [1] https://github.com/yaml/pyyaml/issues/265 *** /tmp/tmpton7Uz/bug_body In Ubuntu, the attached patch was applied to achieve the following: * debian/patches/fix_pyyaml_default_flow_style.patch: Make sure all calls to yaml.dump() include default_flow_style=None, to retain previous behavior that is checked for in tests, unless it's already otherwise specified. Thanks for considering the patch. -- System Information: Debian Release: buster/sid APT prefers eoan APT policy: (500, 'eoan') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 5.2.0-8-generic (SMP w/4 CPU cores) Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled
diff -Nru lavacli-0.9.7/debian/patches/fix_pyyaml_default_flow_style.patch lavacli-0.9.7/debian/patches/fix_pyyaml_default_flow_style.patch --- lavacli-0.9.7/debian/patches/fix_pyyaml_default_flow_style.patch 1969-12-31 19:00:00.000000000 -0500 +++ lavacli-0.9.7/debian/patches/fix_pyyaml_default_flow_style.patch 2019-08-08 16:56:08.000000000 -0400 @@ -0,0 +1,185 @@ +Index: lavacli-0.9.7/lavacli/commands/aliases.py +=================================================================== +--- lavacli-0.9.7.orig/lavacli/commands/aliases.py ++++ lavacli-0.9.7/lavacli/commands/aliases.py +@@ -99,7 +99,7 @@ def handle_list(proxy, options, _): + if options.output_format == "json": + print(json.dumps(aliases)) + elif options.output_format == "yaml": +- print(yaml.dump(aliases).rstrip("\n")) ++ print(yaml.dump(aliases, default_flow_style=None).rstrip("\n")) + else: + print("Aliases:") + for alias in aliases: +@@ -112,7 +112,7 @@ def handle_show(proxy, options, config): + if options.output_format == "json": + print(json.dumps(alias)) + elif options.output_format == "yaml": +- print(yaml.dump(alias).rstrip("\n")) ++ print(yaml.dump(alias, default_flow_style=None).rstrip("\n")) + else: + if config["version"] >= (2019, 5): + print("name : %s" % alias["name"]) +Index: lavacli-0.9.7/lavacli/commands/device_types.py +=================================================================== +--- lavacli-0.9.7.orig/lavacli/commands/device_types.py ++++ lavacli-0.9.7/lavacli/commands/device_types.py +@@ -260,7 +260,7 @@ def handle_aliases(proxy, options): + if options.output_format == "json": + print(json.dumps(aliases)) + elif options.output_format == "yaml": +- print(yaml.dump(aliases).rstrip("\n")) ++ print(yaml.dump(aliases, default_flow_style=None).rstrip("\n")) + else: + print("Aliases:") + for alias in aliases: +@@ -287,7 +287,7 @@ def handle_list(proxy, options): + if options.output_format == "json": + print(json.dumps(device_types)) + elif options.output_format == "yaml": +- print(yaml.dump(device_types).rstrip("\n")) ++ print(yaml.dump(device_types, default_flow_style=None).rstrip("\n")) + else: + print("Device-Types:") + for dt in device_types: +@@ -301,7 +301,7 @@ def handle_show(proxy, options): + if options.output_format == "json": + print(json.dumps(dt)) + elif options.output_format == "yaml": +- print(yaml.dump(dt).rstrip("\n")) ++ print(yaml.dump(dt, default_flow_style=None).rstrip("\n")) + else: + print("name : %s" % dt["name"]) + print("description : %s" % dt["description"]) +Index: lavacli-0.9.7/lavacli/commands/devices.py +=================================================================== +--- lavacli-0.9.7.orig/lavacli/commands/devices.py ++++ lavacli-0.9.7/lavacli/commands/devices.py +@@ -337,7 +337,7 @@ def handle_list(proxy, options, config): + if options.output_format == "json": + print(json.dumps(devices)) + elif options.output_format == "yaml": +- print(yaml.dump(devices).rstrip("\n")) ++ print(yaml.dump(devices, default_flow_style=None).rstrip("\n")) + else: + print("Devices:") + for device in devices: +@@ -386,7 +386,7 @@ def handle_show(proxy, options, config): + if options.output_format == "json": + print(json.dumps(device)) + elif options.output_format == "yaml": +- print(yaml.dump(device).rstrip("\n")) ++ print(yaml.dump(device, default_flow_style=None).rstrip("\n")) + else: + print("name : %s" % device["hostname"]) + print("device-type : %s" % device["device_type"]) +@@ -418,7 +418,7 @@ def handle_tags(proxy, options, _): + if options.output_format == "json": + print(json.dumps(tags)) + elif options.output_format == "yaml": +- print(yaml.dump(tags).rstrip("\n")) ++ print(yaml.dump(tags, default_flow_style=None).rstrip("\n")) + else: + print("Tags:") + for tag in tags: +Index: lavacli-0.9.7/lavacli/commands/jobs.py +=================================================================== +--- lavacli-0.9.7.orig/lavacli/commands/jobs.py ++++ lavacli-0.9.7/lavacli/commands/jobs.py +@@ -370,7 +370,7 @@ def handle_list(proxy, options, config): + if options.output_format == "json": + print(json.dumps(jobs)) + elif options.output_format == "yaml": +- print(yaml.dump(jobs).rstrip("\n")) ++ print(yaml.dump(jobs, default_flow_style=None).rstrip("\n")) + else: + print( + "Jobs (from %s to %s):" % (1 + options.start, options.start + options.limit) +@@ -568,7 +568,7 @@ def handle_queue(proxy, options, config) + if options.output_format == "json": + print(json.dumps(data)) + elif options.output_format == "yaml": +- print(yaml.dump(data).rstrip("\n")) ++ print(yaml.dump(data, default_flow_style=None).rstrip("\n")) + else: + print( + "Jobs (from %s to %s):" % (1 + options.start, options.start + options.limit) +@@ -687,7 +687,7 @@ def handle_show(proxy, options, config): + job["submit_time"] = job["submit_time"].value + job["start_time"] = job["start_time"].value + job["end_time"] = job["end_time"].value +- print(yaml.dump(job).rstrip("\n")) ++ print(yaml.dump(job, default_flow_style=None).rstrip("\n")) + else: + print("id : %s" % job["id"]) + print("description : %s" % job["description"]) +Index: lavacli-0.9.7/lavacli/commands/results.py +=================================================================== +--- lavacli-0.9.7.orig/lavacli/commands/results.py ++++ lavacli-0.9.7/lavacli/commands/results.py +@@ -68,7 +68,7 @@ def handle(proxy, options, _): + if options.output_format == "json": + print(json.dumps(results)) + elif options.output_format == "yaml": +- print(yaml.dump(results).rstrip("\n")) ++ print(yaml.dump(results, default_flow_style=None).rstrip("\n")) + else: + # Only print the result + if options.test_case is not None: +Index: lavacli-0.9.7/lavacli/commands/system.py +=================================================================== +--- lavacli-0.9.7.orig/lavacli/commands/system.py ++++ lavacli-0.9.7/lavacli/commands/system.py +@@ -220,7 +220,7 @@ def handle_export(proxy, options, config + + # Dump the configuration + with (dest / "instance.yaml").open("w", encoding="utf-8") as f_out: +- f_out.write(yaml.dump(export).rstrip("\n")) ++ f_out.write(yaml.dump(export, default_flow_style=None).rstrip("\n")) + return 0 + + +Index: lavacli-0.9.7/lavacli/commands/tags.py +=================================================================== +--- lavacli-0.9.7.orig/lavacli/commands/tags.py ++++ lavacli-0.9.7/lavacli/commands/tags.py +@@ -93,7 +93,7 @@ def handle_list(proxy, options): + if options.output_format == "json": + print(json.dumps(tags)) + elif options.output_format == "yaml": +- print(yaml.dump(tags).rstrip("\n")) ++ print(yaml.dump(tags, default_flow_style=None).rstrip("\n")) + else: + print("Tags:") + for tag in tags: +@@ -109,7 +109,7 @@ def handle_show(proxy, options): + if options.output_format == "json": + print(json.dumps(tag)) + elif options.output_format == "yaml": +- print(yaml.dump(tag).rstrip("\n")) ++ print(yaml.dump(tag, default_flow_style=None).rstrip("\n")) + else: + print("name : %s" % tag["name"]) + print("description: %s" % tag["description"]) +Index: lavacli-0.9.7/lavacli/commands/workers.py +=================================================================== +--- lavacli-0.9.7.orig/lavacli/commands/workers.py ++++ lavacli-0.9.7/lavacli/commands/workers.py +@@ -201,7 +201,7 @@ def handle_list(proxy, options, _): + if options.output_format == "json": + print(json.dumps(workers)) + elif options.output_format == "yaml": +- print(yaml.dump(workers).rstrip("\n")) ++ print(yaml.dump(workers, default_flow_style=None).rstrip("\n")) + else: + print("Workers:") + for worker in workers: +@@ -242,7 +242,7 @@ def handle_show(proxy, options, config): + elif options.output_format == "yaml": + if "last_ping" in worker: + worker["last_ping"] = worker["last_ping"].value +- print(yaml.dump(worker).rstrip("\n")) ++ print(yaml.dump(worker, default_flow_style=None).rstrip("\n")) + else: + print("hostname : %s" % worker["hostname"]) + print("description : %s" % worker["description"]) diff -Nru lavacli-0.9.7/debian/patches/series lavacli-0.9.7/debian/patches/series --- lavacli-0.9.7/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 +++ lavacli-0.9.7/debian/patches/series 2019-08-08 16:52:02.000000000 -0400 @@ -0,0 +1 @@ +fix_pyyaml_default_flow_style.patch