Skip to content

Commit 2d970a2

Browse files
committed
Trim useless blank lines in generated config file
The proxy-server.conf file had many blank lines due to optional parameters and bad usage of erb templating. Change-Id: I3c8e7cdb284e052c82e9a339c12eb7f60bb4ee12
1 parent f991b40 commit 2d970a2

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

spec/classes/swift_proxy_spec.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ class { swift: swift_hash_path_suffix => string }"
6262
#
6363
[DEFAULT]
6464
bind_port = 8080
65-
6665
bind_ip = 127.0.0.1
67-
6866
workers = 1
6967
user = swift
7068
log_name = proxy-server
@@ -73,8 +71,6 @@ class { swift: swift_hash_path_suffix => string }"
7371
log_headers = False
7472
log_address = /dev/log
7573
76-
77-
7874
[pipeline:main]
7975
pipeline = healthcheck cache tempauth proxy-server
8076
@@ -87,10 +83,6 @@ class { swift: swift_hash_path_suffix => string }"
8783
log_handoffs = true
8884
allow_account_management = true
8985
account_autocreate = true
90-
91-
92-
93-
9486
')
9587
end
9688

@@ -136,18 +128,14 @@ class { swift: swift_hash_path_suffix => string }
136128
#
137129
[DEFAULT]
138130
bind_port = 80
139-
140131
bind_ip = 10.0.0.2
141-
142132
workers = 3
143133
user = swift
144134
log_name = swift-proxy-server
145135
log_facility = LOG_LOCAL1
146136
log_level = DEBUG
147137
log_headers = False
148138
log_address = /dev/log
149-
150-
151139
cors_allow_origin = http://foo.bar:1234,https://foo.bar
152140
strict_cors_mode = true
153141
@@ -223,9 +211,7 @@ class { swift: swift_hash_path_suffix => string }
223211
#
224212
[DEFAULT]
225213
bind_port = 80
226-
227214
bind_ip = 10.0.0.2
228-
229215
workers = 3
230216
user = swift
231217
log_name = swift-proxy-server

templates/proxy-server.conf.erb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#
33
[DEFAULT]
44
bind_port = <%= @port %>
5-
<% if @proxy_local_net_ip %>
5+
<% if @proxy_local_net_ip -%>
66
bind_ip = <%= @proxy_local_net_ip %>
7-
<% end %>
7+
<% end -%>
88
workers = <%= @workers %>
99
user = swift
1010
log_name = <%= @log_name %>
@@ -14,11 +14,11 @@ log_headers = <%= @log_headers %>
1414
log_address = <%= @log_address %>
1515
<% if @log_udp_host -%>
1616
# If set, log_udp_host will override log_address
17-
log_udp_host = <%= @log_udp_host -%>
18-
<% end %>
17+
log_udp_host = <%= @log_udp_host %>
18+
<% end -%>
1919
<% if @log_udp_host and @log_udp_port -%>
20-
log_udp_port = <%= @log_udp_port -%>
21-
<% end %>
20+
log_udp_port = <%= @log_udp_port %>
21+
<% end -%>
2222
<% if @cors_allow_origin -%>
2323
cors_allow_origin = <%= @cors_allow_origin %>
2424
strict_cors_mode = <%= @strict_cors_mode %>
@@ -38,14 +38,14 @@ allow_account_management = <%= @allow_account_management %>
3838
account_autocreate = <%= @account_autocreate %>
3939
<% if @read_affinity -%>
4040
sorting_method = affinity
41-
read_affinity = <%= @read_affinity -%>
42-
<% end %>
41+
read_affinity = <%= @read_affinity %>
42+
<% end -%>
4343
<% if @write_affinity -%>
44-
write_affinity = <%= @write_affinity -%>
45-
<% end %>
44+
write_affinity = <%= @write_affinity %>
45+
<% end -%>
4646
<% if @write_affinity_node_count -%>
47-
write_affinity_node_count = <%= @write_affinity_node_count -%>
48-
<% end %>
47+
write_affinity_node_count = <%= @write_affinity_node_count %>
48+
<% end -%>
4949
<% if @node_timeout -%>
50-
node_timeout = <%= @node_timeout -%>
51-
<% end %>
50+
node_timeout = <%= @node_timeout %>
51+
<% end -%>

0 commit comments

Comments
 (0)