mirror of
https://github.com/systemd/systemd
synced 2024-07-21 10:17:21 +00:00
Merge pull request #28562 from yuwata/ukify-option-length
ukify: check option length
This commit is contained in:
commit
ae85704760
|
@ -144,6 +144,11 @@ def test_apply_config(tmp_path):
|
|||
assert ns.phase_path_groups == [['enter-initrd:leave-initrd:sysinit:ready:shutdown:final']]
|
||||
|
||||
def test_parse_args_minimal():
|
||||
try:
|
||||
ukify.parse_args([])
|
||||
except ValueError as e:
|
||||
print(f'expected failure: {e}')
|
||||
|
||||
opts = ukify.parse_args('arg1 arg2'.split())
|
||||
assert opts.linux == pathlib.Path('arg1')
|
||||
assert opts.initrd == [pathlib.Path('arg2')]
|
||||
|
|
|
@ -1484,7 +1484,7 @@ def finalize_options(opts):
|
|||
# Figure out which syntax is being used, one of:
|
||||
# ukify verb --arg --arg --arg
|
||||
# ukify linux initrd…
|
||||
if opts.positional[0] == 'inspect':
|
||||
if len(opts.positional) >= 1 and opts.positional[0] == 'inspect':
|
||||
opts.verb = opts.positional[0]
|
||||
opts.files = opts.positional[1:]
|
||||
if not opts.files:
|
||||
|
|
Loading…
Reference in a new issue