mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 21:31:26 -07:00
add static facility and apply to register (#49737)
* add static facility and apply to register * added warning * added test for templated register * test register 'static' status * rely on subshell to deal with quote context * use corrects pb for test * bring constants back cause new code in devel
This commit is contained in:
parent
ffac260c66
commit
be776daefe
7 changed files with 29 additions and 1 deletions
|
@ -41,6 +41,7 @@ class Attribute:
|
|||
alias=None,
|
||||
extend=False,
|
||||
prepend=False,
|
||||
static=False,
|
||||
):
|
||||
|
||||
"""
|
||||
|
@ -86,6 +87,7 @@ class Attribute:
|
|||
self.alias = alias
|
||||
self.extend = extend
|
||||
self.prepend = prepend
|
||||
self.static = static
|
||||
|
||||
if default is not None and self.isa in _CONTAINERS and not callable(default):
|
||||
raise TypeError('defaults for FieldAttribute may not be mutable, please provide a callable instead')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue