2 # Chris Lumens <clumens@redhat.com>
4 # Copyright 2007, 2009, 2013 Red Hat, Inc.
6 # This copyrighted material is made available to anyone wishing to use, modify,
7 # copy, or redistribute it subject to the terms and conditions of the GNU
8 # General Public License v.2. This program is distributed in the hope that it
9 # will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the
10 # implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # See the GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License along with
14 # this program; if not, write to the Free Software Foundation, Inc., 51
15 # Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat
16 # trademarks that are incorporated in the source code or documentation are not
17 # subject to the GNU General Public License and may only be used or replicated
18 # with the express permission of Red Hat, Inc.
20 from pykickstart
.base
import KickstartCommand
21 from pykickstart
.options
import KSOptionParser
24 _
= lambda x
: gettext
.ldgettext("pykickstart", x
)
26 class F19_Liveimg(KickstartCommand
):
27 removedKeywords
= KickstartCommand
.removedKeywords
28 removedAttrs
= KickstartCommand
.removedAttrs
30 def __init__(self
, *args
, **kwargs
):
31 KickstartCommand
.__init
__(self
, *args
, **kwargs
)
32 self
.checksum
= kwargs
.get("checksum", "")
33 self
.noverifyssl
= kwargs
.get("noverifyssl", None)
34 self
.proxy
= kwargs
.get("proxy", None)
35 self
.url
= kwargs
.get("url", None)
37 self
.op
= self
._getParser
()
39 def __eq__(self
, other
):
40 return self
.url
== other
.url
and self
.proxy
== other
.proxy
and \
41 self
.noverifyssl
== other
.noverifyssl
and \
42 self
.checksum
== other
.checksum
45 retval
= KickstartCommand
.__str
__(self
)
49 retval
+= "# Use live disk image installation\n"
51 retval
+= "liveimg --url=\"%s\"" % self
.url
54 retval
+= " --proxy=\"%s\"" % self
.proxy
57 retval
+= " --noverifyssl"
60 retval
+= " --checksum=\"%s\"" % self
.checksum
66 op
.add_option("--url", required
=1)
67 op
.add_option("--proxy")
68 op
.add_option("--noverifyssl", action
="store_true", default
=False)
69 op
.add_option("--checksum")
72 def parse(self
, args
):
73 (opts
, _extra
) = self
.op
.parse_args(args
=args
, lineno
=self
.lineno
)
74 self
._setToSelf
(self
.op
, opts
)