def halt(self):
self.login()
self.child.send("halt\n")
try:
# Wait for text confirming the halt, or EOF
self.child.expect("(The operating system has halted)|(entering state S5)", timeout = 60)
except pexpect.EOF:
# Didn't see the text but got an EOF; that's OK.
print "EOF"
except pexpect.TIMEOUT, e:
# This is unexpected but mostly harmless
print "timeout waiting for halt confirmation:", e
# Calling this directly is deprecated, use Anita.login()
评论列表
文章目录