wic: Code cleanup: bad-classmethod-argument
PATCH 1/1 wic: Code cleanup: bad-classmethod-argument
Fixed wrong name for the first argument in class methods. Pylint complains about the issue this way:
Class method should have 'cls' as first argument
Signed-off-by Ed Bartosh <[email protected]>
--- scripts/lib/wic/pluginbase.py | 8 ++++---- scripts/lib/wic/plugins/imager/direct_plugin.py | 6 +++--- scripts/lib/wic/plugins/source/bootimg-efi.py | 12 ++++++------ scripts/lib/wic/plugins/source/bootimg-partition.py | 6 +++--- scripts/lib/wic/plugins/source/bootimg-pcbios.py | 6 +++--- scripts/lib/wic/plugins/source/fsimage.py | 6 +++--- scripts/lib/wic/plugins/source/rawcopy.py | 6 +++--- scripts/lib/wic/plugins/source/rootfs.py | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-)
scripts/lib/wic/pluginbase.py +4 -4
@@ -52,7 +52,7 @@ class SourcePlugin(_Plugin): """ @classmethod - def do_install_disk(self, disk, disk_name, cr, workdir, oe_builddir, + def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """ Called after all partitions have been prepared and assembled into a
@@ -62,7 +62,7 @@ class SourcePlugin(_Plugin): msger.debug("SourcePlugin: do_install_disk: disk: %s" % disk_name) @classmethod - def do_stage_partition(self, part, source_params, cr, cr_workdir, + def do_stage_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """
@@ -79,7 +79,7 @@ class SourcePlugin(_Plugin): msger.debug("SourcePlugin: do_stage_partition: part: %s" % part) @classmethod - def do_configure_partition(self, part, source_params, cr, cr_workdir, + def do_configure_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """
@@ -90,7 +90,7 @@ class SourcePlugin(_Plugin): msger.debug("SourcePlugin: do_configure_partition: part: %s" % part) @classmethod - def do_prepare_partition(self, part, source_params, cr, cr_workdir, + def do_prepare_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, rootfs_dir, native_sysroot): """
scripts/lib/wic/plugins/imager/direct_plugin.py +3 -3
@@ -45,7 +45,7 @@ class DirectPlugin(ImagerPlugin): name = 'direct' @classmethod - def __rootfs_dir_to_dict(self, rootfs_dirs): + def __rootfs_dir_to_dict(cls, rootfs_dirs): """ Gets a string that contain 'connection=dir' splitted by space and return a dict
@@ -58,7 +58,7 @@ class DirectPlugin(ImagerPlugin): return krootfs_dir @classmethod - def do_create(self, subcmd, opts, *args): + def do_create(cls, subcmd, opts, *args): """ Create direct image, called from creator as 'direct' cmd """
@@ -76,7 +76,7 @@ class DirectPlugin(ImagerPlugin): image_output_dir = args[5] oe_builddir = args[6] - krootfs_dir = self.__rootfs_dir_to_dict(rootfs_dir) + krootfs_dir = cls.__rootfs_dir_to_dict(rootfs_dir) configmgr._ksconf = ksconf
scripts/lib/wic/plugins/source/bootimg-efi.py +6 -6
@@ -42,7 +42,7 @@ class BootimgEFIPlugin(SourcePlugin): name = 'bootimg-efi' @classmethod - def do_configure_grubefi(self, hdddir, cr, cr_workdir): + def do_configure_grubefi(cls, hdddir, cr, cr_workdir): """ Create loader-specific (grub-efi) config """
@@ -76,7 +76,7 @@ class BootimgEFIPlugin(SourcePlugin): cfg.close() @classmethod - def do_configure_gummiboot(self, hdddir, cr, cr_workdir): + def do_configure_gummiboot(cls, hdddir, cr, cr_workdir): """ Create loader-specific (gummiboot) config """
@@ -117,7 +117,7 @@ class BootimgEFIPlugin(SourcePlugin): @classmethod - def do_configure_partition(self, part, source_params, cr, cr_workdir, + def do_configure_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """
@@ -132,9 +132,9 @@ class BootimgEFIPlugin(SourcePlugin): try: if source_params['loader'] == 'grub-efi': - self.do_configure_grubefi(hdddir, cr, cr_workdir) + cls.do_configure_grubefi(hdddir, cr, cr_workdir) elif source_params['loader'] == 'gummiboot': - self.do_configure_gummiboot(hdddir, cr, cr_workdir) + cls.do_configure_gummiboot(hdddir, cr, cr_workdir) else: msger.error("unrecognized bootimg-efi loader: %s" % source_params['loader']) except KeyError:
@@ -142,7 +142,7 @@ class BootimgEFIPlugin(SourcePlugin): @classmethod - def do_prepare_partition(self, part, source_params, cr, cr_workdir, + def do_prepare_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, rootfs_dir, native_sysroot): """
scripts/lib/wic/plugins/source/bootimg-partition.py +3 -3
@@ -40,7 +40,7 @@ class BootimgPartitionPlugin(SourcePlugin): name = 'bootimg-partition' @classmethod - def do_install_disk(self, disk, disk_name, cr, workdir, oe_builddir, + def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """ Called after all partitions have been prepared and assembled into a
@@ -49,7 +49,7 @@ class BootimgPartitionPlugin(SourcePlugin): pass @classmethod - def do_configure_partition(self, part, source_params, cr, cr_workdir, + def do_configure_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """
@@ -60,7 +60,7 @@ class BootimgPartitionPlugin(SourcePlugin): pass @classmethod - def do_prepare_partition(self, part, source_params, cr, cr_workdir, + def do_prepare_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, rootfs_dir, native_sysroot): """
scripts/lib/wic/plugins/source/bootimg-pcbios.py +3 -3
@@ -41,7 +41,7 @@ class BootimgPcbiosPlugin(SourcePlugin): name = 'bootimg-pcbios' @classmethod - def do_install_disk(self, disk, disk_name, cr, workdir, oe_builddir, + def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """ Called after all partitions have been prepared and assembled into a
@@ -68,7 +68,7 @@ class BootimgPcbiosPlugin(SourcePlugin): raise ImageError("Unable to set MBR to %s" % full_path) @classmethod - def do_configure_partition(self, part, source_params, cr, cr_workdir, + def do_configure_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """
@@ -117,7 +117,7 @@ class BootimgPcbiosPlugin(SourcePlugin): cfg.close() @classmethod - def do_prepare_partition(self, part, source_params, cr, cr_workdir, + def do_prepare_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, rootfs_dir, native_sysroot): """
scripts/lib/wic/plugins/source/fsimage.py +3 -3
@@ -29,7 +29,7 @@ class FSImagePlugin(SourcePlugin): name = 'fsimage' @classmethod - def do_install_disk(self, disk, disk_name, cr, workdir, oe_builddir, + def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """ Called after all partitions have been prepared and assembled into a
@@ -38,7 +38,7 @@ class FSImagePlugin(SourcePlugin): pass @classmethod - def do_configure_partition(self, part, source_params, cr, cr_workdir, + def do_configure_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """
@@ -48,7 +48,7 @@ class FSImagePlugin(SourcePlugin): pass @classmethod - def do_prepare_partition(self, part, source_params, cr, cr_workdir, + def do_prepare_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, rootfs_dir, native_sysroot): """
scripts/lib/wic/plugins/source/rawcopy.py +3 -3
@@ -29,7 +29,7 @@ class RawCopyPlugin(SourcePlugin): name = 'rawcopy' @classmethod - def do_install_disk(self, disk, disk_name, cr, workdir, oe_builddir, + def do_install_disk(cls, disk, disk_name, cr, workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """ Called after all partitions have been prepared and assembled into a
@@ -38,7 +38,7 @@ class RawCopyPlugin(SourcePlugin): pass @classmethod - def do_configure_partition(self, part, source_params, cr, cr_workdir, + def do_configure_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, native_sysroot): """
@@ -48,7 +48,7 @@ class RawCopyPlugin(SourcePlugin): pass @classmethod - def do_prepare_partition(self, part, source_params, cr, cr_workdir, + def do_prepare_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, rootfs_dir, native_sysroot): """
scripts/lib/wic/plugins/source/rootfs.py +2 -2
@@ -58,7 +58,7 @@ class RootfsPlugin(SourcePlugin): return image_rootfs_dir @classmethod - def do_prepare_partition(self, part, source_params, cr, cr_workdir, + def do_prepare_partition(cls, part, source_params, cr, cr_workdir, oe_builddir, bootimg_dir, kernel_dir, krootfs_dir, native_sysroot): """
@@ -81,7 +81,7 @@ class RootfsPlugin(SourcePlugin): msg += " or it is not a valid path, exiting" msger.error(msg % part.rootfs) - real_rootfs_dir = self.__get_rootfs_dir(rootfs_dir) + real_rootfs_dir = cls.__get_rootfs_dir(rootfs_dir) part.set_rootfs(real_rootfs_dir) part.prepare_rootfs(cr_workdir, oe_builddir, real_rootfs_dir, native_sysroot)
Signature · 1 line
2.1.4