#NEWLINE# def exit_config_mode( self , exit_config = 'end' ) : #NEWLINE# #INDENT# 'Exit configuration mode.' #NEWLINE# output = '' #NEWLINE# if self . check_config_mode ( ) : #NEWLINE# #INDENT# output = self . send_command ( exit_config , strip_prompt = False , strip_command = False ) #NEWLINE# if ( 'Uncommitted changes found' in self ) : #NEWLINE# #INDENT# output += self . send_command ( 'no\n' , strip_prompt = False , strip_command = False ) #NEWLINE# #UNINDENT# if self . check_config_mode ( ) : #NEWLINE# #INDENT# raise ValueError ( 'Failed to exit configuration mode' ) #NEWLINE# #UNINDENT# #UNINDENT# return output