mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Always use an ordered dict for yaml renderer
This commit is contained in:
parent
5d806a9f9e
commit
79fed61dc4
@ -13,22 +13,12 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def get_yaml_loader(argline):
|
||||
try:
|
||||
opts, args = getopt.getopt(argline.split(), 'o')
|
||||
except getopt.GetoptError:
|
||||
log.error(
|
||||
'''Example usage: #!yaml [-o]
|
||||
Options:
|
||||
-o Use OrderedDict for YAML map and omap.
|
||||
This option is only useful when combined with another renderer that
|
||||
takes advantage of the ordering.
|
||||
''')
|
||||
raise
|
||||
if ('-o', '') in opts:
|
||||
def Loader(*args): # pylint: disable=C0103
|
||||
return CustomLoader(*args, dictclass=OrderedDict)
|
||||
return Loader
|
||||
return CustomLoader
|
||||
'''
|
||||
Return the ordered dict yaml loader
|
||||
'''
|
||||
def yaml_loader(*args):
|
||||
return CustomLoader(*args, dictclass=OrderedDict)
|
||||
return yaml_loader
|
||||
|
||||
|
||||
def render(yaml_data, env='', sls='', argline='', **kws):
|
||||
|
Loading…
Reference in New Issue
Block a user