Add placeholder for fqdn in reverse notation

This commit is contained in:
Gregor Kleen 2017-12-11 23:00:38 +01:00
parent e838b48b60
commit 85fb38e2f3
4 changed files with 10 additions and 0 deletions

View File

@ -42,6 +42,9 @@ The (short) hostname of the machine.
.B {fqdn}
The full name of the machine.
.TP
.B {reverse-fqdn}
The full name of the machine in reverse domain name notation.
.TP
.B {now}
The current local date and time, by default in ISO\-8601 format.
You can also supply your own \fI\%format string\fP, e.g. {now:%Y\-%m\-%d_%H:%M:%S}

View File

@ -169,6 +169,9 @@ placeholders:
{fqdn}
The full name of the machine.
{reverse-fqdn}
The full name of the machine in reverse domain name notation.
{now}
The current local date and time, by default in ISO-8601 format.
You can also supply your own `format string <https://docs.python.org/3.5/library/datetime.html#strftime-and-strptime-behavior>`_, e.g. {now:%Y-%m-%d_%H:%M:%S}

View File

@ -1901,6 +1901,9 @@ class Archiver:
{fqdn}
The full name of the machine.
{reverse-fqdn}
The full name of the machine in reverse domain name notation.
{now}
The current local date and time, by default in ISO-8601 format.
You can also supply your own `format string <https://docs.python.org/3.5/library/datetime.html#strftime-and-strptime-behavior>`_, e.g. {now:%Y-%m-%d_%H:%M:%S}

View File

@ -183,6 +183,7 @@ def replace_placeholders(text):
data = {
'pid': os.getpid(),
'fqdn': socket.getfqdn(),
'reverse-fqdn': '.'.join(reversed(socket.getfqdn().split('.'))),
'hostname': socket.gethostname(),
'now': DatetimeWrapper(current_time.now()),
'utcnow': DatetimeWrapper(current_time.utcnow()),