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?