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
.constants
import *
15 from pykickstart
.errors
import *
16 from pykickstart
.options
import *
18 from rhpl
.translate
import _
19 import rhpl
.translate
as translate
21 translate
.textdomain("pykickstart")
23 class FC3_Reboot(KickstartCommand
):
24 def __init__(self
, writePriority
=0, action
=KS_WAIT
):
25 KickstartCommand
.__init
__(self
, writePriority
)
29 if self
.action
== KS_REBOOT
:
30 return "# Reboot after installation\nreboot\n"
31 elif self
.action
== KS_SHUTDOWN
:
32 return "# Shutdown after installation\nshutdown\n"
34 def parse(self
, args
):
35 if self
.currentCmd
== "reboot":
36 self
.action
= KS_REBOOT
38 self
.action
= KS_SHUTDOWN
40 class FC6_Reboot(FC3_Reboot
):
41 def __init__(self
, writePriority
=0, action
=KS_WAIT
, eject
=False):
42 FC3_Reboot
.__init
__(self
, writePriority
, action
=action
)
48 if self
.action
== KS_REBOOT
:
49 retval
= "# Reboot after installation\nreboot\n"
50 elif self
.action
== KS_SHUTDOWN
:
51 retval
= "# Shutdown after installation\nshutdown\n"
58 def parse(self
, args
):
59 if self
.currentCmd
== "reboot":
60 self
.action
= KS_REBOOT
62 self
.action
= KS_SHUTDOWN
64 op
= KSOptionParser(lineno
=self
.lineno
)
65 op
.add_option("--eject", dest
="eject", action
="store_true",
68 (opts
, extra
) = op
.parse_args(args
=args
)
69 self
._setToSelf
(op
, opts
)