Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prohibit empty string for $compression #309

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# [*compression*]
# String. Which compression algorithim to use
# Default: comp-lzo
# Options: comp-lzo or '' (disable compression)
# Options: comp-lzo or undef (disable compression)
#
# [*dev*]
# String. Device method
Expand Down Expand Up @@ -195,7 +195,7 @@
#
define openvpn::client (
String $server,
String $compression = 'comp-lzo',
Optional[String[1]] $compression = 'comp-lzo',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it doesn’t default to undef, how am I supposed to set it to undef?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a call of the defined type like this ?

openvpn::client { 'myclient':
  compression => undef,
  ...
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. If you do that, it'll use the default value.

String $dev = 'tun',
Integer $mute = 20,
Boolean $mute_replay_warnings = true,
Expand Down
4 changes: 2 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# [*compression*]
# String. Which compression algorithim to use
# Default: comp-lzo
# Options: comp-lzo or '' (disable compression)
# Options: comp-lzo or undef (disable compression)
#
# [*dev*]
# String. TUN/TAP virtual network device
Expand Down Expand Up @@ -448,7 +448,7 @@
Optional[String] $email = undef,
Optional[Array] $remote = undef,
String $common_name = 'server',
String $compression = 'comp-lzo',
Optional[String[1]] $compression = 'comp-lzo',
String $dev = 'tun0',
String $user = 'nobody',
Optional[String] $group = undef,
Expand Down
2 changes: 1 addition & 1 deletion templates/client.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ proto <%= @proto %>
<% @remote_host.each do |item| -%>
remote <%= item %> <%= @port %>
<% end -%>
<% if @compression != '' -%>
<% if @compression -%>
<%= @compression %>
<% end -%>
resolv-retry <%= @resolv_retry %>
Expand Down
2 changes: 1 addition & 1 deletion templates/server.erb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ tls-server
<% if @tls_client -%>
tls-client
<% end -%>
<% if @compression != '' -%>
<% if @compression -%>
<%= @compression %>
<% end -%>
group <%= @group_to_set %>
Expand Down