From 2251cf0ad084195331d3c0fa4da453f3e910f81d Mon Sep 17 00:00:00 2001 From: James Simpson Date: Wed, 9 Nov 2022 13:57:29 +0800 Subject: T4796: Default args to list where list is expected custom_apt_entry, custom_apt_key, and custom_package are expected to be lists, but when a value is not provided they default to None. This prevents lists provided in mix-in or flavor configurations from being merged as expected. https://docs.python.org/3/library/argparse.html#default --- scripts/build-vyos-image | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/build-vyos-image b/scripts/build-vyos-image index 5242a7dd..27351210 100755 --- a/scripts/build-vyos-image +++ b/scripts/build-vyos-image @@ -164,9 +164,9 @@ if __name__ == "__main__": parser.add_argument('--dry-run', help='Check build configuration and exit', action='store_true') # Custom APT entry and APT key options can be used multiple times - parser.add_argument('--custom-apt-entry', help="Custom APT entry", action='append') - parser.add_argument('--custom-apt-key', help="Custom APT key file", action='append') - parser.add_argument('--custom-package', help="Custom package to install from repositories", action='append') + parser.add_argument('--custom-apt-entry', help="Custom APT entry", action='append', default=[]) + parser.add_argument('--custom-apt-key', help="Custom APT key file", action='append', default=[]) + parser.add_argument('--custom-package', help="Custom package to install from repositories", action='append', default=[]) # Build flavor is a positional argument parser.add_argument('build_flavor', help='Build flavor', nargs='?', action='store') -- cgit v1.2.3