# # httpservlet.rb -- HTTPServlet Module # # Author: IPR -- Internet Programming with Ruby -- writers # Copyright (c) 2000 TAKAHASHI Masayoshi, GOTOU Yuuzou # Copyright (c) 2002 Internet Programming with Ruby writers. All rights # reserved. # # $IPR: abstract.rb,v 1.24 2003/07/11 11:16:46 gotoyuzo Exp $ require 'thread' require 'webrick/htmlutils' require 'webrick/httputils' require 'webrick/httpstatus' module WEBrick module HTTPServlet class HTTPServletError < StandardError; end class AbstractServlet def self.get_instance(config, *options) self.new(config, *options) end def initialize(server, *options) @server = @config = server @logger = @server[:Logger] @options = options end def service(req, res) method_name = "do_" + req.request_method.gsub(/-/, "_") if respond_to?(method_name) __send__(method_name, req, res) else raise HTTPStatus::MethodNotAllowed, "unsupported method `#{req.request_method}'." end end def do_GET(req, res) raise HTTPStatus::NotFound, "not found." end def do_HEAD(req, res) do_GET(req, res) end def do_OPTIONS(req, res) m = self.methods.grep(/^do_[A-Z]+$/) m.collect!{|i| i.sub(/do_/, "") } m.sort! res["allow"] = m.join(",") end private def redirect_to_directory_uri(req, res) if req.path[-1] != ?/ location = req.path + "/" if req.query_string && req.query_string.size > 0 location << "?" << req.query_string end res.set_redirect(HTTPStatus::MovedPermanently, location) end end end end end /public_git/anaconda.git/tree/kickstart.py?h=r0-7-3&id=79e681f0f100f23c368a922184a86918f246ad8c'>treecommitdiffstats
path: root/kickstart.py
blob: 7e5ea59074610077f54ab785dd32698e241c8e1b (plain)
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
import isys
from installclass import InstallClass
import getopt
import sys

class Kickstart(InstallClass):

    def doRootPw(self, args):
	(args, extra) = getopt.getopt(args, '', [ 'iscrypted=' ])

	isCrypted = 0
	for n in args:
	    (str, arg) = n
	    if (str == '--iscrypted'):
		isCrypted = 1

	InstallClass.doRootPw(self, extra[0], isCrypted = isCrypted)
	self.addToSkipList("accounts")

    def doAuthconfig(self, args):
	(args, extra) = getopt.getopt(args, '',
		[ 'enablenis', 'nisdomain=', 'nisserver=', 'useshadow',
		  'enablemd5' ])

	useNis = 0
	useShadow = 0
	useMd5 = 0
	nisServer = None
	nisDomain = None
	nisBroadcast = 0
	
	for n in args:
	    (str, arg) = n
	    if (str == '--enablenis'):
		useNis = 1
	    elif (str == '--useshadow'):
		useShadow = 1
	    elif (str == '--enablemd5'):
		useMd5 = 1
	    elif (str == '--nisserver'):
		nisServer = arg
	    elif (str == '--nisdomain'):
		nisDomain = arg

	if useNis and not nisServer: nisBroadcast = 1
	    
	self.setAuthentication(useShadow, useMd5, useNis, nisDomain,
			       nisBroadcast, nisServer)
	self.addToSkipList("authentication")

    def doLilo	(self, args):
	(args, extra) = getopt.getopt(args, '',