ianmiell / shutit

Automation framework for programmers
http://ianmiell.github.io/shutit/
MIT License
2.15k stars 110 forks source link

Prevent/ignore logouts without matching logins. #276

Closed ianmiell closed 7 years ago

ianmiell commented 7 years ago

        if len(self.login_stack):                                                                                                                                                 
            _ = self.login_stack.pop()                                                                                                                                            
            if len(self.login_stack):                                                                                                                                             
                old_prompt_name  = self.login_stack[-1]                                                                                                                           
                self.default_expect = shutit.expect_prompts[old_prompt_name]                                                                                                      
            else:                                                                                                                                                                 
                # If none are on the stack, we assume we're going to the root prompt                                                                                              
                # set up in shutit_setup.py                                                                                                                                       
                shutit.set_default_shutit_pexpect_session_expect()                                                                                                                
        else:                                                                                                                                                                     
            shutit.fail('Logout called without corresponding login', throw_exception=False)        

Already there. So does this work?