diff --git a/tools/yaml-nic-config-2-script.py b/tools/yaml-nic-config-2-script.py index a2b92baf54..cd5b3b3acf 100755 --- a/tools/yaml-nic-config-2-script.py +++ b/tools/yaml-nic-config-2-script.py @@ -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)