diff options
author | James Simpson <james.simpson@canonical.com> | 2022-11-09 13:57:29 +0800 |
---|---|---|
committer | jsimpso <james.simpson@canonical.com> | 2022-11-09 13:57:29 +0800 |
commit | 2251cf0ad084195331d3c0fa4da453f3e910f81d (patch) | |
tree | c4c103c9aaff1bc23d97419689485c60c88e0a7b /scripts/build-vyos-image | |
parent | 1e4e65f55ba7cc19f78a28f32814877cf2cf2212 (diff) | |
download | vyos-build-2251cf0ad084195331d3c0fa4da453f3e910f81d.tar.gz vyos-build-2251cf0ad084195331d3c0fa4da453f3e910f81d.zip |
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
Diffstat (limited to 'scripts/build-vyos-image')
-rwxr-xr-x | scripts/build-vyos-image | 6 |
1 files changed, 3 insertions, 3 deletions
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') |