[wic][PATCH 9/9] wic: get rid of 2 getters

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

Used partitions and configfile bootloader attributes instead of
using getters get_bootloader_file and get_partitions.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
scripts/lib/wic/imager/direct.py | 2 +-
scripts/lib/wic/plugins/source/bootimg-efi.py | 4 ++--
scripts/lib/wic/plugins/source/bootimg-pcbios.py | 11 ++++++-----
3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/scripts/lib/wic/imager/direct.py b/scripts/lib/wic/imager/direct.py
index 09ff5f8..8d4daec 100644
--- a/scripts/lib/wic/imager/direct.py
+++ b/scripts/lib/wic/imager/direct.py
@@ -159,7 +159,7 @@ class DirectImageCreator(BaseImageCreator):
self.ks.partitions.append(part)

# partitions list from kickstart file
- return kickstart.get_partitions(self.ks)
+ return self.ks.partitions

def get_disk_names(self):
""" Returns a list of physical target disk names (e.g., 'sdb') which
diff --git a/scripts/lib/wic/plugins/source/bootimg-efi.py b/scripts/lib/wic/plugins/source/bootimg-efi.py
index 8bfa3a9..22f9813 100644
--- a/scripts/lib/wic/plugins/source/bootimg-efi.py
+++ b/scripts/lib/wic/plugins/source/bootimg-efi.py
@@ -46,7 +46,7 @@ class BootimgEFIPlugin(SourcePlugin):
"""
Create loader-specific (grub-efi) config
"""
- configfile = kickstart.get_bootloader_file(creator.ks)
+ configfile = creator.ks.bootloader.configfile
custom_cfg = None
if configfile:
custom_cfg = get_custom_config(configfile)
@@ -104,7 +104,7 @@ class BootimgEFIPlugin(SourcePlugin):
cfg.write(loader_conf)
cfg.close()

- configfile = kickstart.get_bootloader_file(creator.ks)
+ configfile = creator.ks.bootloader.configfile
custom_cfg = None
if configfile:
custom_cfg = get_custom_config(configfile)
diff --git a/scripts/lib/wic/plugins/source/bootimg-pcbios.py b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
index e84bddf..0b5478e 100644
--- a/scripts/lib/wic/plugins/source/bootimg-pcbios.py
+++ b/scripts/lib/wic/plugins/source/bootimg-pcbios.py
@@ -84,18 +84,19 @@ class BootimgPcbiosPlugin(SourcePlugin):
install_cmd = "install -d %s" % hdddir
exec_cmd(install_cmd)

- configfile = kickstart.get_bootloader_file(creator.ks)
+ bootloader = creator.ks.bootloader
+
custom_cfg = None
- if configfile:
- custom_cfg = get_custom_config(configfile)
+ if bootloader.configfile:
+ custom_cfg = get_custom_config(bootloader.configfile)
if custom_cfg:
# Use a custom configuration for grub
syslinux_conf = custom_cfg
msger.debug("Using custom configuration file "
- "%s for syslinux.cfg" % configfile)
+ "%s for syslinux.cfg" % bootloader.configfile)
else:
msger.error("configfile is specified but failed to "
- "get it from %s." % configfile)
+ "get it from %s." % bootloader.configfile)

if not custom_cfg:
# Create syslinux configuration using parameters from wks file
--
2.1.4