2 # Chris Lumens <clumens@redhat.com>
4 # Copyright 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.
15 from pykickstart
.base
import *
16 from pykickstart
.errors
import *
17 from pykickstart
.options
import *
19 from rhpl
.translate
import _
20 import rhpl
.translate
as translate
22 translate
.textdomain("pykickstart")
24 class FC6_DmRaidData(BaseData
):
25 def __init__(self
, name
="", devices
=None, dmset
=None):
26 BaseData
.__init
__(self
)
32 self
.devices
= devices
36 retval
= "dmraid --name=%s" % self
.name
38 for dev
in self
.devices
:
39 retval
+= " --dev=\"%s\"" % dev
43 class FC6_DmRaid(KickstartCommand
):
44 def __init__(self
, writePriority
=60, dmraids
=None):
45 KickstartCommand
.__init
__(self
, writePriority
)
50 self
.dmraids
= dmraids
54 for dm
in self
.dmraids
:
55 retval
+= dm
.__str
__()
59 def parse(self
, args
):
60 op
= KSOptionParser(lineno
=self
.lineno
)
61 op
.add_option("--name", dest
="name", action
="store", type="string",
63 op
.add_option("--dev", dest
="devices", action
="append", type="string",
67 (opts
, extra
) = op
.parse_args(args
=args
)
68 dm
.name
= dm
.name
.split('/')[-1]
69 self
._setToObj
(op
, opts
, dm
)
72 def add(self
, newObj
):
73 self
.dmraids
.append(newObj
)