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

Change occurrences of 'if !' to 'unless' where possible. #87

Merged
merged 1 commit into from
Jul 12, 2020
Merged
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
2 changes: 1 addition & 1 deletion manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$service_manage = $chrony::service_manage,
$service_name = $chrony::service_name,
) inherits chrony {
if !($service_ensure in ['running', 'stopped']) {
unless $service_ensure in ['running', 'stopped'] {
fail('service_ensure parameter must be running or stopped')
}

Expand Down
8 changes: 4 additions & 4 deletions templates/chrony.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ rtcsync
# if the adjustment is larger than <%= $chrony::makestep_seconds %> seconds.
makestep <%= $chrony::makestep_seconds %> <%= $chrony::makestep_updates %>
<% } -%>
<% if ! $chrony::queryhosts.empty { -%>
<% unless $chrony::queryhosts.empty { -%>

# Allow client access.
<% $chrony::queryhosts.each |$allowed| { -%>
Expand All @@ -38,7 +38,7 @@ allow <%= $allowed %>
<% if $chrony::cmdport { -%>
cmdport <%= $chrony::cmdport %>
<% } -%>
<% if ! $chrony::bindcmdaddress.empty { -%>
<% unless $chrony::bindcmdaddress.empty { -%>

<% $chrony::bindcmdaddress.each |$addr| { -%>
bindcmdaddress <%= $addr %>
Expand Down Expand Up @@ -67,7 +67,7 @@ keyfile <%= $chrony::config_keys %>
dumponexit
dumpdir <%= $chrony::dumpdir %>
<% } -%>
<% if ! $chrony::clientlog { -%>
<% unless $chrony::clientlog { -%>

# Disable logging of client accesses.
noclientlog
Expand Down Expand Up @@ -128,7 +128,7 @@ smoothtime <%= $chrony::smoothtime %>
# https://chrony.tuxfamily.org/doc/3.4/chrony.conf.html#rtconutc
rtconutc
<% } -%>
<% if ! $chrony::hwtimestamps.empty { -%>
<% unless $chrony::hwtimestamps.empty { -%>

# Enable hardware timestamping of NTP packets sent to and received from the specified
# network interface. If the specified interface is *, chronyd will try to enable HW
Expand Down