[rhel7] Fix the value written to /etc/sysconfig/desktop

Chris Lumens clumens at redhat.com
Mon Oct 6 14:53:42 UTC 2014


> diff --git a/pyanaconda/desktop.py b/pyanaconda/desktop.py
> index 8b5a388..7428a71 100644
> --- a/pyanaconda/desktop.py
> +++ b/pyanaconda/desktop.py
> @@ -45,9 +45,8 @@ class Desktop(object):
>  
>      def write(self):
>          if self.desktop:
> -            f = open(iutil.getSysroot() + "/etc/sysconfig/desktop", "w")
> -            f.write(str(self))
> -            f.close()
> +            with open(iutil.getSysroot() + "/etc/sysconfig/desktop", "w") as f:
> +                f.write("DESKTOP=%s\n" % self.desktop)
>  
>          if not os.path.isdir(iutil.getSysroot() + '/etc/systemd/system'):
>              log.warning("there is no /etc/systemd/system directory, cannot update default.target!")

ACK.

- Chris


More information about the anaconda-patches mailing list