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:
Harald Jensås 2018-09-27 15:51:05 +02:00
parent 7495f12a7c
commit 0b58798c8e
1 changed files with 1 additions and 0 deletions

View File

@ -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)