[anaconda][rhel7-branch/master/f23-branch][PATCH] Run systemctl only once for Initial setup services (#1252444)

David Shea dshea at redhat.com
Thu Sep 3 15:07:07 UTC 2015


On 09/03/2015 10:55 AM, Martin Kolman wrote:
> We already call systemctl with a list of all installed Initial Setup services,
> so there is no need to call it multiple times.
>
> Related: rhbz#1252444
> Signed-off-by: Martin Kolman <mkolman at redhat.com>
> ---
>   pyanaconda/kickstart.py | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index e21242f..13dc93a 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -708,9 +708,8 @@ class Firstboot(commands.firstboot.FC3_Firstboot):
>           if self.firstboot == FIRSTBOOT_SKIP:
>               action = "disable"
>   
> -        for service in services:
> -            # enable/disable all installed Initial Setup services
> -            iutil.execInSysroot("systemctl", [action] + services)
> +        # enable/disable all installed Initial Setup services
> +        iutil.execInSysroot("systemctl", [action] + services)
>   
>   class Group(commands.group.F12_Group):
>       def execute(self, storage, ksdata, instClass, users):

I think the reason for the loop is that if you do something like 
`systemctl enable initial-setup-text.service 
initial-setup-graphical.service`, and only initial-setup-text is 
installed, the command will fail. So the loop should probably stay but 
call systemctl on "service" instead of "services"


More information about the anaconda-patches mailing list