mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add a convenience function for gathering options
This commit is contained in:
parent
2e134d0e18
commit
e87ae00e99
@ -67,3 +67,15 @@ def accept_key(pki_dir, pub, id_):
|
||||
with open(key, 'w+') as fp_:
|
||||
fp_.write(pub)
|
||||
|
||||
|
||||
def get_option(option, opts, vm_):
|
||||
'''
|
||||
Convenience function to return the dominant option to be used. Always
|
||||
default to options set in the vm structure, but if the option is not
|
||||
present there look for it in the main config file
|
||||
'''
|
||||
if option in vm_:
|
||||
return vm_[options]
|
||||
if option in opts:
|
||||
return opts[options]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user