Skip to content

Commit f71bcaa

Browse files
frozencemeterysimo5
authored andcommitted
Replace strings.Template with str.format() in Python code
Signed-off-by: Robbie Harwood <rharwood@redhat.com> Resolves: #163
1 parent ad31b87 commit f71bcaa

File tree

2 files changed

+93
-97
lines changed

2 files changed

+93
-97
lines changed

tests/httpd.conf

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
ServerRoot "${HTTPROOT}"
2-
ServerName "${HTTPNAME}"
3-
Listen ${HTTPADDR}:${HTTPPORT}
4-
Listen ${HTTPADDR}:${PROXYPORT}
1+
ServerRoot "{HTTPROOT}"
2+
ServerName "{HTTPNAME}"
3+
Listen {HTTPADDR}:{HTTPPORT}
4+
Listen {HTTPADDR}:{PROXYPORT}
55

66
LoadModule access_compat_module modules/mod_access_compat.so
77
LoadModule actions_module modules/mod_actions.so
@@ -77,7 +77,7 @@ LoadModule proxy_http_module modules/mod_proxy_http.so
7777

7878
LoadModule auth_gssapi_module mod_auth_gssapi.so
7979

80-
Mutex file:${HTTPROOT}
80+
Mutex file:{HTTPROOT}
8181

8282
<Directory />
8383
Options +Includes
@@ -86,13 +86,13 @@ Mutex file:${HTTPROOT}
8686
Require all denied
8787
</Directory>
8888

89-
DocumentRoot "${HTTPROOT}/html"
90-
<Directory "${HTTPROOT}">
89+
DocumentRoot "{HTTPROOT}/html"
90+
<Directory "{HTTPROOT}">
9191
AllowOverride None
9292
# Allow open access:
9393
Require all granted
9494
</Directory>
95-
<Directory "${HTTPROOT}/html">
95+
<Directory "{HTTPROOT}/html">
9696
Options Indexes FollowSymLinks
9797
Options +Includes
9898
AddOutputFilter INCLUDES .html
@@ -108,10 +108,10 @@ DocumentRoot "${HTTPROOT}/html"
108108
Require all denied
109109
</Files>
110110

111-
PidFile "${HTTPROOT}/logs/httpd.pid"
111+
PidFile "{HTTPROOT}/logs/httpd.pid"
112112

113113
<IfModule log_config_module>
114-
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
114+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{{Referer}}i\" \"%{{User-Agent}}i\"" combined
115115
CustomLog "logs/access_log" combined
116116
</IfModule>
117117

@@ -131,7 +131,7 @@ AddDefaultCharset UTF-8
131131

132132
IncludeOptional conf.d/*.conf
133133

134-
CoreDumpDirectory "${HTTPROOT}"
134+
CoreDumpDirectory "{HTTPROOT}"
135135

136136

137137
<Location /spnego>
@@ -141,11 +141,11 @@ CoreDumpDirectory "${HTTPROOT}"
141141
GssapiUseSessions On
142142
Session On
143143
SessionCookieName gssapi_session path=/spnego;httponly
144-
GssapiSessionKey file:${HTTPROOT}/session.key
145-
GssapiCredStore ccache:${HTTPROOT}/tmp/httpd_krb5_ccache
146-
GssapiCredStore client_keytab:${HTTPROOT}/http.keytab
147-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
148-
GssapiDelegCcacheDir ${HTTPROOT}
144+
GssapiSessionKey file:{HTTPROOT}/session.key
145+
GssapiCredStore ccache:{HTTPROOT}/tmp/httpd_krb5_ccache
146+
GssapiCredStore client_keytab:{HTTPROOT}/http.keytab
147+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
148+
GssapiDelegCcacheDir {HTTPROOT}
149149
GssapiDelegCcachePerms mode:0666
150150
GssapiBasicAuth Off
151151
GssapiAllowedMech krb5
@@ -158,14 +158,14 @@ CoreDumpDirectory "${HTTPROOT}"
158158

159159
AuthType GSSAPI
160160
AuthName "Login"
161-
GssapiCredStore ccache:${HTTPROOT}/tmp/httpd_krb5_ccache
162-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
161+
GssapiCredStore ccache:{HTTPROOT}/tmp/httpd_krb5_ccache
162+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
163163
GssapiAllowedMech krb5
164164
Require valid-user
165165

166166
RewriteEngine on
167-
RewriteCond %{REQUEST_FILENAME} !-d
168-
RewriteCond %{REQUEST_FILENAME} !-f
167+
RewriteCond %{{REQUEST_FILENAME}} !-d
168+
RewriteCond %{{REQUEST_FILENAME}} !-f
169169
RewriteRule . /spnego_rewrite/index.html [L]
170170
</Location>
171171

@@ -176,9 +176,9 @@ CoreDumpDirectory "${HTTPROOT}"
176176
GssapiUseSessions On
177177
Session On
178178
SessionCookieName gssapi_session path=/spnego_negotiate_once;httponly
179-
GssapiCredStore ccache:${HTTPROOT}/tmp/httpd_krb5_ccache
180-
GssapiCredStore client_keytab:${HTTPROOT}/http.keytab
181-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
179+
GssapiCredStore ccache:{HTTPROOT}/tmp/httpd_krb5_ccache
180+
GssapiCredStore client_keytab:{HTTPROOT}/http.keytab
181+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
182182
GssapiBasicAuth Off
183183
GssapiAllowedMech krb5
184184
GssapiNegotiateOnce On
@@ -191,9 +191,9 @@ CoreDumpDirectory "${HTTPROOT}"
191191
AuthType GSSAPI
192192
AuthName "Password Login"
193193
GssapiSSLonly Off
194-
GssapiCredStore ccache:${HTTPROOT}/tmp/httpd_krb5_ccache
195-
GssapiCredStore client_keytab:${HTTPROOT}/http.keytab
196-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
194+
GssapiCredStore ccache:{HTTPROOT}/tmp/httpd_krb5_ccache
195+
GssapiCredStore client_keytab:{HTTPROOT}/http.keytab
196+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
197197
GssapiBasicAuth On
198198
GssapiBasicAuthMech krb5
199199
GssapiConnectionBound On
@@ -205,9 +205,9 @@ CoreDumpDirectory "${HTTPROOT}"
205205
AuthType GSSAPI
206206
AuthName "Bad Acceptor Name"
207207
GssapiSSLonly Off
208-
GssapiCredStore ccache:${HTTPROOT}/tmp/httpd_krb5_ccache
209-
GssapiCredStore client_keytab:${HTTPROOT}/http.keytab
210-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
208+
GssapiCredStore ccache:{HTTPROOT}/tmp/httpd_krb5_ccache
209+
GssapiCredStore client_keytab:{HTTPROOT}/http.keytab
210+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
211211
GssapiAcceptorName BAD@example.com
212212
Require valid-user
213213
</Location>
@@ -217,9 +217,9 @@ CoreDumpDirectory "${HTTPROOT}"
217217
AuthType GSSAPI
218218
AuthName "Login"
219219
GssapiSSLonly Off
220-
GssapiCredStore ccache:${HTTPROOT}/tmp/httpd_krb5_ccache
221-
GssapiCredStore client_keytab:${HTTPROOT}/http.keytab
222-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
220+
GssapiCredStore ccache:{HTTPROOT}/tmp/httpd_krb5_ccache
221+
GssapiCredStore client_keytab:{HTTPROOT}/http.keytab
222+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
223223
GssapiBasicAuth On
224224
GssapiAllowedMech krb5
225225
Require valid-user
@@ -229,19 +229,19 @@ CoreDumpDirectory "${HTTPROOT}"
229229
AuthType GSSAPI
230230
AuthName "Login"
231231
GssapiSSLonly Off
232-
GssapiCredStore ccache:${HTTPROOT}/tmp/httpd_krb5_ccache
233-
GssapiCredStore client_keytab:${HTTPROOT}/http.keytab
234-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
232+
GssapiCredStore ccache:{HTTPROOT}/tmp/httpd_krb5_ccache
233+
GssapiCredStore client_keytab:{HTTPROOT}/http.keytab
234+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
235235
GssapiBasicAuth Off
236236
GssapiAllowedMech krb5
237-
GssapiAcceptorName {HOSTNAME}
237+
GssapiAcceptorName {{HOSTNAME}}
238238
Require valid-user
239239
</Location>
240240

241241
<Location /required_name_attr1>
242242
AuthType GSSAPI
243243
AuthName "Required Name Attributes"
244-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
244+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
245245
GssapiRequiredNameAttributes auth-indicators=na1
246246
LogLevel debug
247247
Require valid-user
@@ -250,7 +250,7 @@ CoreDumpDirectory "${HTTPROOT}"
250250
<Location /required_name_attr2>
251251
AuthType GSSAPI
252252
AuthName "Required Name Attributes"
253-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
253+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
254254
GssapiRequiredNameAttributes auth-indicators:=bmEx
255255
LogLevel debug
256256
Require valid-user
@@ -259,7 +259,7 @@ CoreDumpDirectory "${HTTPROOT}"
259259
<Location /required_name_attr3>
260260
AuthType GSSAPI
261261
AuthName "Required Name Attributes"
262-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
262+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
263263
GssapiRequiredNameAttributes (auth-indicators=foo and auth-indicators=na2) or auth-indicators=na3
264264
LogLevel debug
265265
Require valid-user
@@ -268,22 +268,22 @@ CoreDumpDirectory "${HTTPROOT}"
268268
<Location /required_name_attr4>
269269
AuthType GSSAPI
270270
AuthName "Required Name Attributes"
271-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
271+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
272272
GssapiRequiredNameAttributes auth-indicators=foo
273273
LogLevel debug
274274
Require valid-user
275275
</Location>
276276

277-
<VirtualHost *:${PROXYPORT}>
277+
<VirtualHost *:{PROXYPORT}>
278278
ProxyRequests On
279279
ProxyVia On
280280

281281
<Proxy *>
282282
AuthType GSSAPI
283283
AuthName "Proxy Login"
284-
GssapiCredStore ccache:${HTTPROOT}/tmp/httpd_krb5_ccache
285-
GssapiCredStore client_keytab:${HTTPROOT}/http.keytab
286-
GssapiCredStore keytab:${HTTPROOT}/http.keytab
284+
GssapiCredStore ccache:{HTTPROOT}/tmp/httpd_krb5_ccache
285+
GssapiCredStore client_keytab:{HTTPROOT}/http.keytab
286+
GssapiCredStore keytab:{HTTPROOT}/http.keytab
287287
GssapiBasicAuth On
288288
Require valid-user
289289
</Proxy>

0 commit comments

Comments
 (0)