[master/f21/rhel7] Add authconfig and firewalld packages when used in ks (#1147687)

Vratislav Podzimek vpodzime at redhat.com
Tue Oct 14 11:33:36 UTC 2014


On Mon, 2014-10-13 at 16:00 -0700, Brian C. Lane wrote:
> Only include the packages in the packageset if the commands are seen in
> the kickstart.
> ---
>  pyanaconda/install.py   |  6 ++++++
>  pyanaconda/kickstart.py | 16 ++++++++++++++++
>  2 files changed, 22 insertions(+)
> 
> diff --git a/pyanaconda/install.py b/pyanaconda/install.py
> index 0393204..e179b99 100644
> --- a/pyanaconda/install.py
> +++ b/pyanaconda/install.py
> @@ -206,6 +206,10 @@ def doInstall(storage, payload, ksdata, instClass):
>          with progress_report(_("Discovering realm to join")):
>              ksdata.realm.setup()
>  
> +    # Check for additional packages
> +    ksdata.authconfig.setup()
> +    ksdata.firewall.setup()
> +
>      # make name resolution work for rpm scripts in chroot
>      if flags.can_touch_runtime_system("copy /etc/resolv.conf to sysroot"):
>          network.copyFileToPath("/etc/resolv.conf", iutil.getSysroot())
> @@ -214,6 +218,8 @@ def doInstall(storage, payload, ksdata, instClass):
>      # system is bootable and configurable, and some other packages in order
>      # to finish setting up the system.
>      packages = storage.packages + ksdata.realm.packages
> +    packages += ksdata.authconfig.packages + ksdata.firewall.packages
> +
>      if not ksdata.bootloader.disabled:
>          packages += storage.bootloader.packages
>  
> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index f1cde9a..b2f47a2 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -240,6 +240,14 @@ def refreshAutoSwapSize(storage):
>  ###
>  
>  class Authconfig(commands.authconfig.FC3_Authconfig):
> +    def __init__(self, *args, **kwargs):
> +        commands.authconfig.FC3_Authconfig.__init__(self, *args, **kwargs)
> +        self.packages = []
> +
> +    def setup(self):
> +        if self.seen:
> +            self.packages = ["authconfig"]
> +
>      def execute(self, *args):
>          cmd = "/usr/sbin/authconfig"
>          if not os.path.lexists(iutil.getSysroot()+cmd):
> @@ -605,6 +613,14 @@ class Fcoe(commands.fcoe.RHEL7_Fcoe):
>          return fc
>  
>  class Firewall(commands.firewall.F20_Firewall):
> +    def __init__(self, *args, **kwargs):
> +        commands.firewall.F20_Firewall.__init__(self, *args, **kwargs)
> +        self.packages = []
> +
> +    def setup(self):
> +        if self.seen:
> +            self.packages = ["firewalld"]
> +
>      def execute(self, storage, ksdata, instClass):
>          args = []
>          # enabled is None if neither --enable or --disable is passed
ACK.
-- 
Vratislav Podzimek

Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic




More information about the anaconda-patches mailing list