hyera.exceptions
Exception hierarchy for hiera.
BackendError(*args, path=None)
Bases: HieraError, ValueError
A data file could not be read or parsed. .path names it.
Also a :class:ValueError.
Source code in src/hyera/exceptions.py
37 38 39 | |
BackendTimeoutError(*args, path=None)
Bases: BackendError, TimeoutError
An external program a backend or fact source runs (sops,
facter) did not finish within its time limit and was killed along
with its child processes.
Source code in src/hyera/exceptions.py
37 38 39 | |
ConfigError(*args, path=None, line=None)
Bases: HieraError, ValueError
The base hiera configuration (hiera.yaml) is missing or invalid.
Also a :class:ValueError.
line, when known, is the 1-based line in .path the problem was
found at (e.g. a malformed hierarchy entry).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
object
|
the positional arguments |
()
|
path
|
Optional[str]
|
the file this problem concerns, when known. |
None
|
line
|
Optional[int]
|
the 1-based line in |
None
|
Source code in src/hyera/exceptions.py
57 58 59 60 61 62 63 64 | |
line = line
instance-attribute
HieraError(*args, path=None)
Bases: Exception
Base class for all hiera errors.
path, when known, names the file the problem concerns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
object
|
the positional arguments |
()
|
path
|
Optional[str]
|
the file this problem concerns, when known. |
None
|
Source code in src/hyera/exceptions.py
37 38 39 | |
path = path
instance-attribute
HieraLookupError(*args, path=None)
Bases: HieraError
Puppet's LookupError: a failure while resolving a key.
Source code in src/hyera/exceptions.py
37 38 39 | |
InterpolationError(*args, path=None)
Bases: HieraLookupError, ValueError
A %{...} interpolation or function call could not be resolved.
Also a :class:ValueError.
Source code in src/hyera/exceptions.py
37 38 39 | |
KeyNotFoundError(name)
Bases: HieraLookupError, KeyError
Puppet's lookup() miss: no value was found for name.
Also a :class:KeyError, so an existing except KeyError keeps
working. name is the key string, or list of key strings, that was
tried; a list of one uses the singular message form. A name may also
be a tuple key path: .name keeps it exactly as given, but
the message text renders it as :func:~hyera._lookup.navigation.join_key's
dotted form, same as the equivalent quoted string would read.
A bare tuple path is never passed here directly -- it would be
misread as "several names" instead of one path with several segments.
Every caller wraps it in a list first (even a list of one), the
same way a single str name already is.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Union[str, Sequence[str]]
|
the key(s) that were tried. |
required |
Source code in src/hyera/exceptions.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
name = name
instance-attribute
__reduce__()
Source code in src/hyera/exceptions.py
163 164 165 166 | |
__str__()
Source code in src/hyera/exceptions.py
160 161 | |
MergeError(*args, path=None)
Bases: HieraLookupError, ValueError
An unknown or invalid merge strategy was requested.
Also a :class:ValueError.
Source code in src/hyera/exceptions.py
37 38 39 | |