Fix --grub and --syslinux handling
authorMichael Prokop <mika@grml.org>
Fri, 22 Jan 2021 09:20:41 +0000 (10:20 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 22 Jan 2021 09:20:41 +0000 (10:20 +0100)
With commit 3664e4ae we removed an argument from the grub_option()
and syslinux_warning() callback functions, which was reported as
false positives by vulture tool.

Fixes regression from 3664e4ae, failing grml2usb execution with --grub
(and deprecated --syslinux) command line option with:

| TypeError: grub_option() takes 3 positional arguments but 4 were given

Thanks: Ralf Moll for the bugreport

grml2usb

index d8c5053..8f689a9 100755 (executable)
--- a/grml2usb
+++ b/grml2usb
@@ -64,7 +64,7 @@ RE_P_PARTITION = re.compile(r"(.*?\d+)p(\d+)$")
 RE_LOOP_DEVICE = re.compile(r"/dev/loop\d+$")
 
 
 RE_LOOP_DEVICE = re.compile(r"/dev/loop\d+$")
 
 
-def syslinux_warning(option, opt, opt_parser):
+def syslinux_warning(option, opt, _value, opt_parser):
     """A helper function for printing a warning about deprecated option"""
     # pylint: disable-msg=W0613
     sys.stderr.write(
     """A helper function for printing a warning about deprecated option"""
     # pylint: disable-msg=W0613
     sys.stderr.write(
@@ -75,7 +75,7 @@ def syslinux_warning(option, opt, opt_parser):
 
 
 # if grub option is set, unset syslinux option
 
 
 # if grub option is set, unset syslinux option
-def grub_option(option, opt, opt_parser):
+def grub_option(option, opt, _value, opt_parser):
     """A helper function adjusting other option values"""
     # pylint: disable-msg=W0613
     setattr(opt_parser.values, option.dest, True)
     """A helper function adjusting other option values"""
     # pylint: disable-msg=W0613
     setattr(opt_parser.values, option.dest, True)