Don't set any default values on these commands.
[pykickstart.git] / pykickstart / commands / upgrade.py
blob35e3d8b91c1aeb9ac87a584c17a818f2761a1021
2 # Chris Lumens <clumens@redhat.com>
4 # Copyright 2005, 2006, 2007 Red Hat, Inc.
6 # This software may be freely redistributed under the terms of the GNU
7 # general public license.
9 # You should have received a copy of the GNU General Public License
10 # along with this program; if not, write to the Free Software
11 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
13 from pykickstart.base import *
14 from pykickstart.errors import *
15 from pykickstart.options import *
17 from rhpl.translate import _
18 import rhpl.translate as translate
20 translate.textdomain("pykickstart")
22 class FC3_Upgrade(KickstartCommand):
23 def __init__(self, writePriority=0, upgrade=None):
24 KickstartCommand.__init__(self, writePriority)
25 self.upgrade = upgrade
27 def __str__(self):
28 if self.upgrade is None:
29 return ""
31 if self.upgrade:
32 return "# Upgrade existing installation\nupgrade\n"
33 else:
34 return "# Install OS instead of upgrade\ninstall\n"
36 def parse(self, args):
37 if len(args) > 0:
38 raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s does not take any arguments") % "upgrade")
40 if self.currentCmd == "upgrade":
41 self.upgrade = True
42 else:
43 self.upgrade = False