]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: fix pylint warning unused-variable
authorEd Bartosh <ed.bartosh@linux.intel.com>
Wed, 2 Sep 2015 10:58:13 +0000 (13:58 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 2 Sep 2015 22:46:51 +0000 (23:46 +0100)
Removed or reworked code with unused variables.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/wic/engine.py
scripts/lib/wic/imager/baseimager.py
scripts/lib/wic/imager/direct.py
scripts/lib/wic/plugin.py
scripts/lib/wic/plugins/source/bootimg-efi.py
scripts/wic

index a034841a7a3e8cf5bf008eb463e19b4d95281c52..30c4fa38dc951258e2461a5cac6f509da633daea 100644 (file)
@@ -43,9 +43,7 @@ def verify_build_env():
 
     Returns True if it is, false otherwise
     """
-    try:
-        builddir = os.environ["BUILDDIR"]
-    except KeyError:
+    if not os.environ.get("BUILDDIR"):
         print "BUILDDIR not found, exiting. (Did you forget to source oe-init-build-env?)"
         sys.exit(1)
 
index 67a2d0116b8b53557b7f549e3967df03be62f55a..4abcabca4b90b76a4ef4af4605327c78696294cb 100644 (file)
@@ -132,9 +132,9 @@ class BaseImageCreator(object):
                 os.makedirs(self.workdir)
             self.__builddir = tempfile.mkdtemp(dir=self.workdir,
                                                prefix="imgcreate-")
-        except OSError, (err, msg):
+        except OSError as err:
             raise CreatorError("Failed create build directory in %s: %s" %
-                               (self.tmpdir, msg))
+                               (self.tmpdir, err))
 
     def __setup_tmpdir(self):
         if not self.enabletmpfs:
index d68fd2a8c51712b143c65b58eb430225ec5910b1..74ebbe79b6dc23ab735fadf8ba082cc121c25bea 100644 (file)
@@ -327,7 +327,7 @@ class DirectImageCreator(BaseImageCreator):
 
         parts = self._get_parts()
 
-        for disk_name, disk in self.__image.disks.items():
+        for disk_name in self.__image.disks:
             extension = "direct" + {"gzip": ".gz",
                                     "bzip2": ".bz2",
                                     "xz": ".xz",
index e901f807ad1372502d8dce8f1a3fbb9d4fcab21c..7244989d86fffc7a487fe131e63ddfa274f292ee 100644 (file)
@@ -124,12 +124,7 @@ class PluginMgr(object):
 
         self.append_dirs(plugins_dir)
 
-        plugins = []
-
-        for _source_name, klass in self.get_plugins('source').iteritems():
-            plugins.append(_source_name)
-
-        return plugins
+        return self.get_plugins('source')
 
 
     def get_source_plugin_methods(self, source_name, methods):
index 49d5c8ae8269905a815182413327345245b04131..b48cc835d671a67c1a70304e69596c7a58af3f72 100644 (file)
@@ -45,12 +45,6 @@ class BootimgEFIPlugin(SourcePlugin):
         """
         Create loader-specific (grub-efi) config
         """
-        splash = os.path.join(cr_workdir, "/EFI/boot/splash.jpg")
-        if os.path.exists(splash):
-            splashline = "menu background splash.jpg"
-        else:
-            splashline = ""
-
         options = cr.ks.handler.bootloader.appendLine
 
         grubefi_conf = ""
index 94028e2b08778993c490c146d1f644ddf5507a0a..c99c5042bdcf0254e8a307865cd3d2f59a1d6c47 100755 (executable)
@@ -308,7 +308,7 @@ def main(argv):
 
     parser.disable_interspersed_args()
 
-    (options, args) = parser.parse_args(argv)
+    args = parser.parse_args(argv)[1]
 
     if len(args):
         if args[0] == "help":