[wic][PATCH 8/9] wic: get rid of set_size and set_source_file setters

Ed Bartosh
2016-01-14T14:15:45Z

Used size and source_file attributes instead of using
setters. It's more pythonic, clear an consistent.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
scripts/lib/wic/plugins/source/bootimg-efi.py | 4 ++--
scripts/lib/wic/plugins/source/bootimg-pcbios.py | 4 ++--
scripts/lib/wic/plugins/source/isoimage-isohybrid.py | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 35afa30..8bfa3a9 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -235,5 +235,5 @@ class BootimgEFIPlugin(SourcePlugin):
out = exec_cmd(du_cmd)
bootimg_size = out.split()[0]

- part.set_size(bootimg_size)
- part.set_source_file(bootimg)
+ part.size = bootimg_size
+ part.source_file = bootimg
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index 255684b..e84bddf 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -205,7 +205,7 @@ class BootimgPcbiosPlugin(SourcePlugin):
out = exec_cmd(du_cmd)
bootimg_size = out.split()[0]

- part.set_size(bootimg_size)
- part.set_source_file(bootimg)
+ part.size = int(out.split()[0])
+ part.source_file = bootimg

diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index b5ca4d3..daefff3 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -302,7 +302,7 @@ class IsoImagePlugin(SourcePlugin):
# which contains rootfs
du_cmd = "du -bks %s" % rootfs_dir
out = exec_cmd(du_cmd)
- part.set_size(int(out.split()[0]))
+ part.size = int(out.split()[0])
part.extra_space = 0
part.overhead_factor = 1.2
part.prepare_rootfs(cr_workdir, oe_builddir, rootfs_dir, \
@@ -502,8 +502,8 @@ class IsoImagePlugin(SourcePlugin):
out = exec_cmd(du_cmd)
isoimg_size = int(out.split()[0])

- part.set_size(isoimg_size)
- part.set_source_file(iso_img)
+ part.size = isoimg_size
+ part.source_file = iso_img

@classmethod
def do_install_disk(cls, disk, disk_name, creator, workdir, oe_builddir,
--
2.1.4