YAML NIC Config 2 script - fix comment indentation
When translating comments into yaml the last_non_comment_spaces must be set to the current spaces prior to insering the comment. Change-Id: Ib5bbb47cfce7d6c0ac0990a3c9384f5143dd1263
This commit is contained in:
parent
7495f12a7c
commit
0b58798c8e
|
@ -60,6 +60,7 @@ def to_commented_yaml(filename):
|
|||
spaces+=' '
|
||||
next;
|
||||
elif char == '#':
|
||||
last_non_comment_spaces = spaces
|
||||
comment_count += 1
|
||||
comment = line[char_count:-1]
|
||||
out_str += "%scomment%i_%i: '%s'\n" % (last_non_comment_spaces, comment_count, len(spaces), comment)
|
||||
|
|
Loading…
Reference in New Issue