1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
#
# kickstartParser.py: Unified kickstart data store for anaconda and
# s-c-kickstart.
#
# Chris Lumens <clumens@redhat.com>
#
# Copyright 2005 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
from constants import *
DISPLAY_MODE_CMDLINE = 0
DISPLAY_MODE_GRAPHICAL = 1
DISPLAY_MODE_TEXT = 2
class KickstartData:
def __init__(self):
# Set by command handlers.
self.authconfig = ""
self.autopart = False
self.autostep = {"autoscreenshot": False}
self.bootloader = {"appendLine": "", "driveorder": [],
"forceLBA": False, "location": "mbr", "md5pass": "",
"password": "", "upgrade": False}
self.clearpart = {"drives": [], "initAll": False,
"type": CLEARPART_TYPE_NONE}
self.displayMode = DISPLAY_MODE_GRAPHICAL
self.firewall = {"enabled": True, "ports": [], "trusts": []}
self.firstboot = FIRSTBOOT_SKIP
self.device = ""
self.deviceprobe = ""
self.displayMode = True
self.driverdisk = ""
self.ignoredisk = []
self.interactive = False
self.keyboard = ""
self.lang = ""
self.mediacheck = False
self.method = {"method": ""}
self.monitor = {"hsync": "", "monitor": "", "vsync": ""}
self.network = []
self.reboot = True
self.rootpw = {"isCrypted": False, "password": ""}
self.selinux = 2
self.skipx = False
self.timezone = {"isUtc": False, "timezone": ""}
self.upgrade = False
self.vnc = {"enabled": False, "password": "", "host": "", "port": ""}
self.xconfig = {"driver": "", "defaultdesktop": "", "depth": 0,
"hsync": "", "monitor": "", "probe": True,
"resolution": "", "startX": False,
"videoRam": "", "vsync": ""}
self.zerombr = False
self.zfcp = {"devnum": "", "fcplun": "", "scsiid": "", "scsilun": "",
"wwpn": ""}
self.lvList = []
self.partitions = []
self.raidList = []
self.vgList = []
# Set by sections.
self.groupList = []
self.packageList = []
self.excludedList = []
self.preScripts = []
self.postScripts = []
self.tracebackScripts = []
def __str__ (self):
str = "authconfig = \"%s\"\n" % self.authconfig
str = str + "autopart = %s\n" % self.autopart
str = str + "autostep = %s\n" % self.autostep
str = str + "bootloader = %s\n" % self.bootloader
str = str + "clearpart = %s\n" % self.clearpart
str = str + "firewall = %s\n" % self.firewall
str = str + "firstboot = %s\n" % self.firstboot
str = str + "ignoredisk = %s\n" % self.ignoredisk
str = str + "interactive = %s\n" % self.interactive
str = str + "keyboard = \"%s\"\n" % self.keyboard
str = str + "lang = \"%s\"\n" % self.lang
str = str + "monitor = %s\n" % self.monitor
str = str + "network = %s\n" % self.network
str = str + "reboot = %s\n" % self.reboot
str = str + "rootpw = %s\n" % self.rootpw
str = str + "selinux = %s\n" % self.selinux
str = str + "skipx = %s\n" % self.skipx
str = str + "timezone = %s\n" % self.timezone
str = str + "upgrade = %s\n" % self.upgrade
str = str + "vnc = %s\n" % self.vnc
str = str + "xconfig = %s\n" % self.xconfig
str = str + "zerombr = %s\n" % self.zerombr
str = str + "zfcp = %s\n" % self.zfcp
str = str + "lvList = %s\n" % self.lvList
str = str + "partitions = %s\n" % self.partitions
str = str + "raidList = %s\n" % self.raidList
str = str + "vgList = %s\n" % self.vgList
str = str + "groupList = %s\n" % self.groupList
str = str + "packageList = %s\n" % self.packageList
str = str + "excludedList = %s\n" % self.excludedList
str = str + "preScripts = %s\n" % self.preScripts
str = str + "postScripts = %s\n" % self.postScripts
str = str + "tracebackScripts = %s\n" % self.tracebackScripts
return str
|