@@ -366,7 +366,7 @@ def ssh_tacacs_handler(spawn, context):
366366def password_handler (spawn , context , session ):
367367 """ handles password prompt
368368 """
369- if 'enable' in spawn .last_sent :
369+ if spawn .last_sent . startswith ( 'enable' ) :
370370 return enable_password_handler (spawn , context , session )
371371
372372 credential = get_current_credential (context = context , session = session )
@@ -780,6 +780,13 @@ def __init__(self):
780780 loop_continue = True ,
781781 continue_timer = True )
782782
783+ self .tclsh_continue_stmt = Statement (pattern = pat .tclsh_continue ,
784+ action = "sendline(})" ,
785+ args = None ,
786+ loop_continue = True ,
787+ continue_timer = False )
788+
789+
783790#############################################################
784791# Statement lists
785792#############################################################
@@ -827,7 +834,8 @@ def __init__(self):
827834initial_statement_list = [generic_statements .init_conf_stmt ,
828835 generic_statements .mgmt_setup_stmt ,
829836 generic_statements .enter_your_selection_stmt ,
830- generic_statements .enter_your_encryption_selection_stmt
837+ generic_statements .enter_your_encryption_selection_stmt ,
838+ generic_statements .tclsh_continue_stmt
831839 ]
832840
833841
@@ -842,4 +850,3 @@ def __init__(self):
842850 authentication_statement_list + \
843851 initial_statement_list + \
844852 pre_connection_statement_list
845-
0 commit comments