From 4445234adee0d5fa7537959d9b4e4f46597d7284 Mon Sep 17 00:00:00 2001 From: Vratislav Podzimek Date: Mon, 15 Jul 2019 15:42:06 +0200 Subject: [PATCH] Add some details about the hostrange() function The documentation of the behavior and formats of arguments needs to be as precise as possible. Ticket: CFE-3104 --- reference/functions/hostrange.markdown | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/reference/functions/hostrange.markdown b/reference/functions/hostrange.markdown index ba934cfe0..55156c409 100644 --- a/reference/functions/hostrange.markdown +++ b/reference/functions/hostrange.markdown @@ -7,11 +7,18 @@ tags: [reference, communication functions, functions, hostrange] [%CFEngine_function_prototype(prefix, range)%] -**Description:** Returns whether the current host lies in the `range` of -enumerated hostnames specified with `prefix`. +**Description:** Returns whether the unqualified name of the current host lies +in the `range` of enumerated hostnames specified with `prefix`. This is a pattern matching function for non-regular (enumerated) -expressions. +expressions. The `range` specification is in the format `A-B` (using a minus +character `-`) where `A` and `B` are decimal integers, optionally prefixed with +zeroes (e.g. `01`). The unqualified name of the current host used in this +function is the same as the contents of the [`sys.uqhost`][sys.uqhost] +variable. The function is using integer comparison on `range` and the last +numeric part of the unqualified host name and string comparison of `prefix` +(lowercase) with the part of the unqualified host name until the last numeric +part. [%CFEngine_function_attributes(prefix, range)%]