summaryrefslogtreecommitdiff
path: root/functions/ensure_ending_period.pp
diff options
context:
space:
mode:
Diffstat (limited to 'functions/ensure_ending_period.pp')
-rw-r--r--functions/ensure_ending_period.pp8
1 files changed, 8 insertions, 0 deletions
diff --git a/functions/ensure_ending_period.pp b/functions/ensure_ending_period.pp
new file mode 100644
index 0000000..76c0003
--- /dev/null
+++ b/functions/ensure_ending_period.pp
@@ -0,0 +1,8 @@
+# Adds a period to end of string if not already present
+function dns::ensure_ending_period(String $s) >> String {
+ if $s[-1] == '.' {
+ $s
+ } else {
+ "${s}."
+ }
+}