[rhel7-branch/master] Print a message and exit if a user attempts to upgrade via kickstart.

Chris Lumens clumens at redhat.com
Wed Dec 18 21:50:32 UTC 2013


> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index c79acd3..d9deb4f 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -1484,6 +1484,14 @@ class Keyboard(commands.keyboard.F18_Keyboard):
>      def dracutSetupArgs(self, *args):
>          return keyboard.dracut_setup_args(self)
>  
> +class Upgrade(commands.upgrade.F20_Upgrade):
> +    # Upgrade is no longer supported. If an upgrade command was included in
> +    # a kickstart, warn the user and exit.
> +    # pylint: disable-msg=W0231
> +    def __init__(self, *args):
> +        log.error("The upgrade kickstart command is no longer supported. Upgrade functionality is provided through redhat-upgrade-tool.")
> +        sys.stderr.write(_("The upgrade kickstart command is no longer supported. Upgrade functionality is provided through redhat-upgrade-tool."))
> +        sys.exit(1)
>  
>  class SpokeRegistry(dict):
>      """This class represents the ksdata.firstboot object and
> @@ -1545,6 +1553,7 @@ commandMap = {
>          "selinux": SELinux,
>          "services": Services,
>          "timezone": Timezone,
> +        "upgrade": Upgrade,
>          "user": User,
>          "volgroup": VolGroup,
>          "xconfig": XConfig,

Did you verify this message does not get printed out if the "install"
command is used in the kickstart file?  In olden days, that was what
you'd say if you weren't doing an upgrade.

- Chris


More information about the anaconda-patches mailing list