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

David Shea dshea at redhat.com
Wed Dec 18 18:54:59 UTC 2013


The expected behavior from the upgrade command is different enough from
what would actually happen that we should terminate the installation
instead of simply ignoring it as deprecated.

Resolves: rhbz#1036756

(Obviously the version on master should say "fedup" and not "redhat-upgrade-tool")
---
 pyanaconda/kickstart.py | 9 +++++++++
 1 file changed, 9 insertions(+)

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,
-- 
1.8.4.2



More information about the anaconda-patches mailing list