saltext.vault.utils.vault.helpers

Several utility functions for the Vault modules

saltext.vault.utils.vault.helpers.iso_to_timestamp(iso_time)[source]

Most endpoints respond with RFC3339-formatted strings This is a hacky way to use inbuilt tools only for converting to a timestamp

saltext.vault.utils.vault.helpers.expand_pattern_lists(pattern, **mappings)[source]

Expands the pattern for any list-valued mappings, such that for any list of length N in the mappings present in the pattern, N copies of the pattern are returned, each with an element of the list substituted.

pattern:

A pattern to expand, for example by-role/{grains[roles]}

mappings:

A dictionary of variables that can be expanded into the pattern.

Example: Given the pattern `` by-role/{grains[roles]}`` and the below grains

grains:
    roles:
        - web
        - database

This function will expand into two patterns, [by-role/web, by-role/database].

Note that this method does not expand any non-list patterns.

saltext.vault.utils.vault.helpers.timestring_map(val)[source]

Turn a time string (like 60m) into a float with seconds as a unit.