YAML syntax for Salt and Python -


what diference between this:

dic1:    - subdict1.1: value11.1   - subdict1.2: value1.2   - cubdict1.3: value1.3 

and this:

dict2:   subdict2.1: value2.2   subdict2.1: value2.2   subdict2.3: value2.3 

i know first 1 evaluates list of dictionaries. second one? isn't list of dictionaries?

no, nested dictionary.

example

yaml code:

first_level_dict_key:   second_level_dict_key: value_in_second_level_dict 

results in python:

{     'first_level_dict_key': {         'second_level_dict_key': 'value_in_second_level_dict'     } } 

explanation salt docs.

rule two: colons

python dictionaries are, of course, key-value pairs. users other languages may recognize data type hashes or associative arrays.

dictionary keys represented in yaml strings terminated trailing colon. values represented either string following colon, separated space


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -