'When using put inside a TCL {} section the newline is considered a new TCL
statement and causes a missing curly-brace message. Convert "
" to "". TCL
will convert the "" to a "
" i.e. you will see a "
" inside the file on the
Cisco IOS device.'

@staticmethod
def _tcl_newline_rationalize(tcl_string):

    NEWLINE = u'\\n'
    CARRIAGE_RETURN = u'\\r'
    tmp_string = re.sub(NEWLINE, CARRIAGE_RETURN, tcl_string)
    if re.search(u'[{}]', tmp_string):
        msg = u'Curly    brace    detected    in    string;    TCL    requires    this    be    escaped.'
        raise ValueError(msg)
    return tmp_string
