]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Code cleanup: bad-classmethod-argument
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 17 Jun 2015 11:25:23 +0000 (14:25 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 23 Jun 2015 10:38:16 +0000 (11:38 +0100)
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 <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/wic/pluginbase.py
scripts/lib/wic/plugins/imager/direct_plugin.py
scripts/lib/wic/plugins/source/bootimg-efi.py
scripts/lib/wic/plugins/source/bootimg-partition.py
scripts/lib/wic/plugins/source/bootimg-pcbios.py
scripts/lib/wic/plugins/source/fsimage.py
scripts/lib/wic/plugins/source/rawcopy.py
scripts/lib/wic/plugins/source/rootfs.py

index 72bcad2b7a3da9bb357ae6eaf13b6f2a256ffb7f..50e442d61cdd34e091a789ea15b46ca0a54d4349 100644 (file)
@@ -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):
         """
index 17888e971c287a2f43b971c292ee76d7c8a8bf5a..1720f7bb201a52c3902b40b8d9395da6ae5157f5 100644 (file)
@@ -36,7 +36,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
@@ -49,7 +49,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
         """
@@ -67,7 +67,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
 
index d3b8468c7b55880dbab9029eea35fcb8f7fbbc99..f50f631313f96e1bc7b519216a2cf8387f8970d2 100644 (file)
@@ -37,7 +37,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
         """
@@ -71,7 +71,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
         """
@@ -112,7 +112,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):
         """
@@ -127,9 +127,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:
@@ -137,7 +137,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):
         """
index 909e59b6e27ccfb60283f89787be8a6be5fc138f..2ffce6b3b386c2e15e1befabb705a58c465c4878 100644 (file)
@@ -35,7 +35,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
@@ -44,7 +44,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):
         """
@@ -55,7 +55,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):
         """
index 5caffbc8e2a47c7687fb01e9e83c2bf45ef76f70..ae5fc0ca2ab266381060e9fde015346a865588cb 100644 (file)
@@ -37,7 +37,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
@@ -64,7 +64,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):
         """
@@ -113,7 +113,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):
         """
index ef56cf278b8329603730a5c763fda6cbdd2ea78f..cd59c6e87ed1e93452b55cd62f2636f0adf188d1 100644 (file)
@@ -25,7 +25,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
@@ -34,7 +34,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):
         """
@@ -44,7 +44,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):
         """
index 444c0268fb4a45148b6a5848b7490a795302cc47..df0785175124b1a2bcfdb7bef3a769aa35dcd414 100644 (file)
@@ -25,7 +25,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
@@ -34,7 +34,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):
         """
@@ -44,7 +44,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):
         """
index 7d444301fbbfecfe742eaa950417ebb70018a387..0ee383efb7f9d19f9fb0c647795749bcac83b369 100644 (file)
@@ -54,7 +54,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):
         """
@@ -77,7 +77,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)