summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-01-31 03:25:10 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-02 17:37:44 +0000
commit2db161f1c0df9ed5047804c396bc6ebfdb0840ef (patch)
treef86e7f6de33a4597852f095307475a17bfb7cb85 /scripts
parentee10c2f1bb26f86aad141c2b622d9365af431cd7 (diff)
downloadpoky-2db161f1c0df9ed5047804c396bc6ebfdb0840ef.tar.gz
wic: get rid of __rootfs_dir_to_dict method
Replaced class method __rootfs_dir_to_dict with a list comprehension. [YOCTO #10619] (From OE-Core rev: 266fd31410771db4c06539f7368c196a6d03000a) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/plugins/imager/direct_plugin.py21
1 files changed, 5 insertions, 16 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct_plugin.py b/scripts/lib/wic/plugins/imager/direct_plugin.py
index 91a9792814..c6df5fbb7d 100644
--- a/scripts/lib/wic/plugins/imager/direct_plugin.py
+++ b/scripts/lib/wic/plugins/imager/direct_plugin.py
@@ -53,21 +53,8 @@ class DirectPlugin(ImagerPlugin):
53 53
54 name = 'direct' 54 name = 'direct'
55 55
56 @classmethod 56 @staticmethod
57 def __rootfs_dir_to_dict(cls, rootfs_dirs): 57 def do_create(opts, *args):
58 """
59 Gets a string that contain 'connection=dir' splitted by
60 space and return a dict
61 """
62 krootfs_dir = {}
63 for rootfs_dir in rootfs_dirs.split(' '):
64 key, val = rootfs_dir.split('=')
65 krootfs_dir[key] = val
66
67 return krootfs_dir
68
69 @classmethod
70 def do_create(cls, opts, *args):
71 """ 58 """
72 Create direct image, called from creator as 'direct' cmd 59 Create direct image, called from creator as 'direct' cmd
73 """ 60 """
@@ -92,7 +79,9 @@ class DirectPlugin(ImagerPlugin):
92 79
93 image_name = "%s-%s" % (splitext(basename(ksconf))[0], 80 image_name = "%s-%s" % (splitext(basename(ksconf))[0],
94 strftime("%Y%m%d%H%M")) 81 strftime("%Y%m%d%H%M"))
95 krootfs_dir = cls.__rootfs_dir_to_dict(rootfs_dir) 82
83 # parse possible 'rootfs=name' items
84 krootfs_dir = dict(rdir.split('=') for rdir in rootfs_dir.split(' '))
96 85
97 creator = DirectImageCreator(image_name, ksobj, oe_builddir, 86 creator = DirectImageCreator(image_name, ksobj, oe_builddir,
98 image_output_dir, krootfs_dir, 87 image_output_dir, krootfs_dir,