3 # Copyright (c) 2013 Intel, Inc.
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the Free
7 # Software Foundation; version 2 of the License
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # You should have received a copy of the GNU General Public License along
15 # with this program; if not, write to the Free Software Foundation, Inc., 59
16 # Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 from pykickstart.base import *
19 from pykickstart.options import *
22 class Mic_installerfw(KickstartCommand):
23 """ This class implements the "installerfw_plugins" KS option. The argument
24 of the option is a comman-separated list of MIC features which have to be
25 disabled and instead, will be done in the installer. For example,
26 "installerfw_plugins=bootloader" disables all the MIC code which installs
27 the bootloader to the target images, and instead, the bootlodaer will be
28 installed by the installer framework plugin.
30 The plugin is a program which is external to MIC, it comes from the
31 installation repositories and can be executed by MIC in order to perform
32 various configuration actions. The main point here is to make sure MIC has
33 no hard-wired knoledge about the target OS configuration. """
35 removedKeywords = KickstartCommand.removedKeywords
36 removedAttrs = KickstartCommand.removedAttrs
38 def __init__(self, *args, **kwargs):
39 KickstartCommand.__init__(self, *args, **kwargs)
40 self.op = self._getParser()
44 retval = KickstartCommand.__str__(self)
47 retval += "# Enable installer framework plugins\ninstallerfw_plugins\n"
55 def parse(self, args):
56 if self.currentCmd == "installerfw":
57 msger.warning("please, use 'installerfw_plugins' instead of " \
58 "'installerfw', the latter is obsolete and will be " \
59 "removed in future releases")
61 (_, extra) = self.op.parse_args(args=args, lineno=self.lineno)
64 msg = "Kickstart command \"%s\" requires one " \
65 "argumet - a list of legacy features to disable" % self.currentCmd
66 raise KickstartValueError, formatErrorMsg(self.lineno, msg = msg)
68 self.features = extra[0].split(",")
70 if "extlinux" in self.features:
71 msger.warning("please, use 'bootloader' installer framework " \
72 "plugin name instead of 'extlinux', the latter " \
73 "is obsolete and will be removed in future releases")
74 # Rename all occurances of "extlinux" to "bootloader"
75 self.features = [ "bootloader" if x == "extlinux" else x
76 for x in self.features ]