diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-01-31 03:25:10 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-02-02 17:37:34 +0000 |
commit | 266fd31410771db4c06539f7368c196a6d03000a (patch) | |
tree | 3e459629721c438f2ccf653896366e9a325e62f6 /scripts/lib/wic | |
parent | a8f5ebb26183faa9af6eb72f4dabfcf83aa1e8d4 (diff) | |
download | openembedded-core-266fd31410771db4c06539f7368c196a6d03000a.tar.gz openembedded-core-266fd31410771db4c06539f7368c196a6d03000a.tar.bz2 openembedded-core-266fd31410771db4c06539f7368c196a6d03000a.zip |
wic: get rid of __rootfs_dir_to_dict method
Replaced class method __rootfs_dir_to_dict with a list
comprehension.
[YOCTO #10619]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r-- | scripts/lib/wic/plugins/imager/direct_plugin.py | 21 |
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): name = 'direct' - @classmethod - def __rootfs_dir_to_dict(cls, rootfs_dirs): - """ - Gets a string that contain 'connection=dir' splitted by - space and return a dict - """ - krootfs_dir = {} - for rootfs_dir in rootfs_dirs.split(' '): - key, val = rootfs_dir.split('=') - krootfs_dir[key] = val - - return krootfs_dir - - @classmethod - def do_create(cls, opts, *args): + @staticmethod + def do_create(opts, *args): """ Create direct image, called from creator as 'direct' cmd """ @@ -92,7 +79,9 @@ class DirectPlugin(ImagerPlugin): image_name = "%s-%s" % (splitext(basename(ksconf))[0], strftime("%Y%m%d%H%M")) - krootfs_dir = cls.__rootfs_dir_to_dict(rootfs_dir) + + # parse possible 'rootfs=name' items + krootfs_dir = dict(rdir.split('=') for rdir in rootfs_dir.split(' ')) creator = DirectImageCreator(image_name, ksobj, oe_builddir, image_output_dir, krootfs_dir, |