Allow escaped comments in inventory files.

This commit is contained in:
Michael DeHaan 2014-03-05 20:10:25 -05:00
parent 4e8ed92130
commit 94a7fb60fe
3 changed files with 34 additions and 1 deletions

View file

@ -1071,3 +1071,12 @@ def random_password(length=20, chars=C.DEFAULT_PASSWORD_CHARS):
password.append(new_char)
return ''.join(password)
def before_comment(msg):
''' what's the part of a string before a comment? '''
msg = msg.replace("\#","**NOT_A_COMMENT**")
msg = msg.split("#")[0]
msg = msg.replace("**NOT_A_COMMENT**","#")
return msg